Compare commits

...

2 Commits

Author SHA1 Message Date
18bc241c5d chore: Last century javascript client/server 2021-10-01 20:29:55 +01:00
170557d88c chore: html pages 2021-10-01 20:28:38 +01:00
74 changed files with 23150 additions and 0 deletions

137
albaran.js Normal file
View File

@ -0,0 +1,137 @@
// //
// JavaScript Functions //
// //
//////////////////////////////////////
// Algunas variables Globales
function InsAlbLins() {
if ( !request.ab_nro_reg ) {
status=-1
return;
}
var i=1;
var nrolineas=0;
var nroctas=0, nro=0;
nro=parseInt(request.nrolineas);
if ( nro+1 > 1 ) {
for (nl=1;nl<=nro;nl++) {
eval('if ( request.al_'+i+'_cantidad+0 != 0 && request.al_'+i+'_precio_und+0 != 0 ) {'+
'status=database.execute("INSERT INTO albalineas(" +'+
'" nro_lin," +'+
'" nro_reg," +'+
'" cantidad," +'+
'" referencia," +'+
'" descripcion," +'+
'" precio_und ) VALUES (\'" + StringClip(true,request.al_'+i+'_nro_lin) + "\',\'" +'+
'StringClip(true,request.ab_nro_reg) + "\',\'"+'+
'NroUnformat(request.al_'+i+'_cantidad) + "\',\'"+'+
'StringClip(true,request.al_'+i+'_referencia) + "\',\'"+'+
'StringClip(true,request.al_'+i+'_descripcion) + "\',\'"+'+
'NroUnformat(request.al_'+i+'_precio_und ) + "\')");}');
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect('error.html?alert=11')
}
DbsError(true,status);
}
}
nroctas=parseInt(request.nroctas);
if ( nroctas+1 > 1 ) {
for (nl=1;nl<=nroctas;nl++) {
eval(' if ( request.ac_'+nl+'_importe+0 != 0 && request.ac_'+nl+'_cod_cta.length > 2 ) {'+
' status=database.execute("INSERT INTO aptecuentas(" + '+
'" nro_lin," + '+
'" nro_reg," +'+
'" tipolin," +'+
'" cod_cta," +'+
'" clave," +'+
'" concepto," +'+
'" importe," +'+
'" tipo_apte," +'+
'" fecha ) VALUES (\'" + StringClip(true,request.ac_'+nl+'_nro_lin) + "\',\'" + '+
'StringClip(true,request.ab_nro_reg) + "\',\'"+'+
'StringClip(true,request.ac_'+nl+'_tipolin) + "\',\'"+'+
'StringClip(true,request.ac_'+nl+'_cod_cta) + "\',\'"+'+
'StringClip(true,request.ac_'+nl+'_clave) + "\',\'"+'+
'StringClip(true,request.ac_'+nl+'_concepto) + "\',\'"+'+
'NroUnformat(request.ac_'+nl+'_importe) + "\',\'"+'+
'StringClip(true,request.ac_'+nl+'_tipo_apte) + "\',\'"+'+
'StringClip(true,datetoString(HOY)) + "\')");}');
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect('error.html?alert=12')
}
DbsError(true,status);
}
}
}
function DelAlbLins() {
status=database.execute("DELETE FROM albalineas WHERE nro_reg = \'" + request.ab_nro_reg + "\'");
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect('error.html')
}
DbsError(true,status);
status=database.execute("DELETE FROM aptecuentas WHERE nro_reg = \'" + request.ab_nro_reg + "\'");
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect('error.html')
}
DbsError(true,status);
}
function scanClaveCta(icta) {
var f=document.f_albaran;
// eval("var clave=f.ac_"+icta+"_clave.value;");
// alert("Clave:"+clave+" linea "+icta);
var importe=0;
var cta="", tipoAte="", tipoLin="";
eval("importe=parseInt(NroUnformat(f.ac_"+icta+"_importe.value));");
eval("cta=f.ac_"+icta+"_cod_cta.value;");
eval("tipoApte=get_value(\'select\',f.ac_"+icta+"_tipo_apte);");
eval("tipoLin=f.ac_"+icta+"_tipolin.value;");
if ( tipoLin == "G" && importe == 0 ) { eval("f.ac_"+icta+"_clave.value=pa_clave_siniva;"); }
if ( tipoLin == "G" && importe > 0 ) { eval("f.ac_"+icta+"_clave.value=pa_clave_coniva;"); }
if ( tipoLin == "G" && importe < 0 ) { eval("f.ac_"+icta+"_clave.value=pa_clave_coniva;"); }
// if ( tipoApte == "D" ) { }
// if ( tipoApte == "H" ) { }
// if ( TipoFra=="2") { // Dev. Retención
// if ( tipoLin == "G" || tipoLin == "R" ) { eval("f.acf_"+icta+"_clave.value=pa_clave_dev;"); };
// }
// if ( TipoRet=="1") { // IRPF
// if ( tipoLin == "G" || tipoLin == "R" ) { eval("f.acf_"+icta+"_clave.value=pa_clave_reten_1;"); }
// }
// if ( TipoRet=="2") { // Por Garantía
// if ( tipoLin == "G" || tipoLin == "R" ) { eval("f.acf_"+icta+"_clave.value=pa_clave_reten_2;"); }
// }
// eval("var clave=f.ac_"+icta+"_clave.value;");
// alert("Clave:"+clave);
}
function AlbDocuHtml(nro_reg) {
var s_seq=getSeqPrt(nprinter);
textoReqs=textoReqs+" "+s_seq;
var nomFile=spoolpath+nprinter+"/req_"+s_seq+".html"
fileRpt=new File(nomFile);
fileRpt.open("w");
fileRpt.writeln('<HTML><HEAD></HEAD>');
nrolin=1;
// CursorTabla("fa","nro_reg","=\'"+nro_reg+"\'",true,"");
// Asignamos a request todas las columnas necesarias para el form.
if (request.f_formato=="documento") {
fileRpt.writeln('</TR></TABLE></CENTER>');
fileRpt.writeln('</BODY>');
fileRpt.writeln('</HTML>');
fileRpt.close();
return nrolin;
}
fileRpt.writeln('</TR></TABLE></CENTER>');
fileRpt.writeln('</BODY>');
fileRpt.writeln('</HTML>');
fileRpt.close();
return nrolin;
}

87
alertpage.html Normal file
View File

@ -0,0 +1,87 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Main Frame in FrameSet</TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (Win95; I) [Netscape]">
</HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<BODY BACKGROUND="images/backgrnd.gif">
<SERVER>
//<!--
writeln("<SCRIPT LANGUAGE='JavaScript'>")
writeln("function Go_Location() {")
if (request.alert == 0 ){
redirect("logout.html?alert=0");
}
if (request.alert == 90 ){
writeln('alert("\\r ¡¡¡ Se desconoce el Usuario en la Base de Datos !!!\\r ")');
}
if (request.alert == 99 ){
writeln('alert("\\r ¡¡¡ No es posible utilizar las Páginas con otro Navegador\\r que no sea NETSCAPE NAVIGATOR 3 !!!\\r ")');
}
if (request.alert == 1 ){
writeln('alert("\\r ¡¡¡ Cursor No Abierto !!!\\r Operación no Realizada")');
}
if (request.alert == 2 ) {
if ( request.key )
writeln(' alert("\\r ¡¡¡ Ya existe un registro con esta clave !!! \\r'+ request.key+'\\r Operación no Realizada")');
else
writeln(' alert("\\r ¡¡¡ Ya existe un registro con esta clave !!! \\r Operación no Realizada")');
}
if (request.alert == 3 ) {
writeln(' alert("\\r ¡¡¡ La conversión de Fecha no es correcta!!! \\r Operación no Realizada")');
}
if (request.alert == 5 ) {
writeln(' alert("\\r ¡¡¡ No es posible realizar la inserción de Datos!!! \\r Operación no Realizada")');
}
if (request.alert == 6 ) {
writeln(' alert("\\r ¡¡¡ No es posible realizar la actualización de Datos!!! \\r Operación no Realizada")');
}
if (request.alert == 7 ) {
writeln(' alert("\\r ¡¡¡ No es posible realizar el borrado de Datos!!! \\r Operación no Realizada")');
}
if (request.alert == 8 ) {
writeln(' alert("\\r ¡¡¡ No es posible realizar la inserción de Datos!!! \\r Transacción no Realizada")');
}
if (request.alert == 9 ) {
writeln(' alert("\\r ¡¡¡ No es posible realizar la actualización de Datos!!! \\r Transacción no Realizada")');
}
if (request.alert == 10 ) {
writeln(' alert("\\r ¡¡¡ No es posible realizar el borrado de Datos!!! \\r Transacción no Realizada")');
}
if (request.alert == 11 ) {
writeln(' alert("\\r ¡¡¡ No es posible realizar la inserción de Líneas !!! \\r Transacción no Realizada")');
}
if (request.alert == 12 ) {
writeln(' alert("\\r ¡¡¡ No es posible realizar la inserción de Cuentas !!! \\r Transacción no Realizada")');
}
if (request.alert == 14 ) {
if ( request.key )
writeln(' alert("\\r ¡¡¡ No es posible realizar el bloqueo del albarán !!! \\r'+ request.key+'\\r Transacción no Realizada")');
else
writeln(' alert("\\r ¡¡¡ No es posible realizar el bloqueo del albarán !!! \\r Transacción no Realizada")');
}
if (request.alert == 15 ) {
if ( request.key )
writeln(' alert("\\r ¡¡¡ No existe la clave !!! \\r'+ request.key+'\\r Transacción no Realizada")');
else
writeln(' alert("\\r ¡¡¡ No existe clave !!! \\r Transacción no Realizada")');
}
if (request.nro_reg) {
writeln(' alert("\\r ¡¡¡ Error en Factura Nro. Reg: '+request.nro_reg+' !!! \\r Operación no Realizada")');
}
writeln(' history.back(-2)')
writeln("}")
writeln("</SCRIPT>")
//}
//-->
</SERVER>
</HEAD>
<BODY ONLOAD="Go_Location()" >
</BODY>
</HTML>

57
ctasapagar.html Normal file
View File

@ -0,0 +1,57 @@
<HTML>
<TITLE>Cuentas a Pagar</TITLE>
<HEAD>
</HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT LANGUAGE= "JavaScript">
<!--
//-->
</SCRIPT>
<SERVER>
var baseHtml="";
if (!request.FrameType || request.FrameType == "null" )
redirect("logout.html");
dbAcl();
client.prevPage ='ctasapagar.html?""'+baseHtml;
if (request.FrameType =="F") {
writeln('<FRAMESET marginheigth=0 marginwidth=0 noresize ROWS="*,18%">');
writeln(' <FRAMESET marginheigth=0 marginwidth=0 noresize cols="18%,*">');
writeln(' <FRAME src="fr_conten.html?'+baseHtml+'" resize="no" scrolling="auto" name="contents">');
writeln(' <FRAMESET rows="25%,*">');
if ( client.MsgScroll == "S" )
writeln(' <FRAME SRC="fr_top.html?'+baseHtml+'" resize="no" SCROLLING=NO name="top">');
else
writeln(' <FRAME SRC="fr_maintop.html?'+baseHtml+'" resize="no" SCROLLING=NO name="top">');
writeln(' <FRAME src="fr_main.html?'+baseHtml+'" scrolling="auto" name="main">');
writeln(' </FRAMESET>');
writeln(' </FRAMESET>');
writeln(' <FRAMESET marginheigth=0 marginwidth=0 noresize cols="15%,55%,*">');
writeln(' <FRAME src="fr_botleft.html?'+baseHtml+'" resize="no" scrolling="no" name="left_bottom">');
writeln(' <FRAME src="fr_bottom.html?'+baseHtml+'" resize="no" scrolling="no" name="center_bottom">');
writeln(' <FRAME src="fr_botright.html?'+baseHtml+'" resize="no" scrolling="no" name="right_bottom">');
writeln(' </FRAMESET>');
writeln('</FRAMESET>');
}
if (request.FrameType =="T") {
writeln('<FRAMESET marginheigth=0 marginwidth=0 noresize cols="18%,*">');
writeln(' <FRAME src="fr_conten.html?'+baseHtml+'" resize="no" scrolling="auto" name="contents">');
writeln(' <FRAMESET marginheigth=0 marginwidth=0 noresize rows="25%,*">');
if ( client.MsgScroll == "S" )
writeln(' <FRAME SRC="fr_top.html?'+baseHtml+'" resize="no" SCROLLING=NO name="top">');
else
writeln(' <FRAME SRC="fr_maintop.html?'+baseHtml+'" resize="no" SCROLLING=NO name="top">');
writeln(' <FRAME src="fr_main.html?'+baseHtml+'"scrolling="auto" name="main">');
writeln(' </FRAMESET>');
writeln('</FRAMESET>');
}
if (request.FrameType =="L") {
writeln('<FRAMESET marginheigth=0 marginwidth=0 noresize cols="18%,*">');
writeln(' <FRAME src="fr_conten.html?'+baseHtml+'" resize="no" scrolling="auto" name="contents">');
writeln(' <FRAME src="fr_main.html?'+baseHtml+'" scrolling="auto" name="main">');
writeln('</FRAMESET>');
}
</SERVER>
</HTML>

958
ctasapagar.js Normal file
View File

@ -0,0 +1,958 @@
// //
// JavaScript Functions //
// //
//////////////////////////////////////
// Algunas variables Globales
var entorno = new entObj(0);
<!-- constructor for object used to step through id|name lists -->
function entObj(appreg) {
this.DirBase="http://ctasapagar.malaga.sando.es/Ctas_a_Pagar";
this.w_parambase="toolbar=yes,location=no,directories=no,menubar=no,status=yes,scrollbars=yes,resizable=yes";
this.w_paramApp="toolbar=yes,location=no,directories=no,menubar=no,status=yes,scrollbars=yes,resizable=yes";
this.appreg=appreg;
this.es_inicio=0;
}
<!-- connect to database if necessary -->
function dbConnect() {
// if (client.es_inicio == 0 ) {
// entorno.es_inicio=client.es_inicio;
// redirect("go_close.html");
// initial.html?ipw=1");
// parent.window.close();
//}
//else
// client.es_inicio=0 ;
if (!database.connected()) {
// arguments:
// database type INFORMIX
// database server <your db server name>
// database login <your db login name>
// database pw <your db password>
// database name tock
// make sure you use a database login that has connect, select, update,
// insert, and delete privileges on the tock database
// database.connect("INFORMIX","appalanche_db", "informix", "informix", "tock");
client.type = "INFORMIX";
client.db_id = "ctpagar";
client.database = "sando_adm";
client.server = "sandodbs";
client.password = "15-admisys";
status=database.connect(client.type,
client.server,
client.db_id,
client.password,
client.database);
DbsError(status,-1);
}
}
function dbAcl()
{
chkBrowser(); // control del Browser
// if (request.FrameType)
// client.FrameType=request.FrameType;
// else
// request.FrameType=client.FrameType;
// Aquí va el control de acceso
// Reasignamos algunas variables globales para el Server
// Algunos formatos para fechas.
NLDF="D/M/YY"; // para columnas en las queries INFORMIX
IFDF="D/M/YY"; // para columnas en SQL según DBDATE
nprinter="hp4mp";
spoolpath="c:/tmprpts/spool/";
// Algunos formatos para nros.
NF2="##"
NF3="###"
NF4="#.###"
NF5="##.###"
NF6="###.###"
NF7="#.###.###"
NF8="##.###.###"
NF9="###.###.###"
NF09="***.***.***"
NFY9="&&&.&&&.&&&"
NF10="#.###.###.###"
NF11="##.###.###.###"
NF12="###.###.###.###"
// client.acl=2;
if (!request.uid || request.uid == null)
redirect("alertpage.html?alert=90");
// request.uid=client.id;
// if (!client.acl) { // Ha perdido el acl !!!!
login = database.cursor("select acl from user where id='"+request.uid+"'");
if (login.next()) {
client.acl = login.acl;
}
login.close();
// }
if (client.acl == 0 || client.acl == null )
redirect("alertpage.html?alert=0");
// if ( request.ViewFkey == "S" || request.ViewFkey == "N" )
// client.ViewFkey = request.ViewFkey;
// client.FrameType= request.FrameType;
// request.FrameType="L";
if (client.acl == 1 ) {
request.waux="1";
baseHtml="FrameType="+request.FrameType+"&ViewFkey="+request.ViewFkey+"&uid="+request.uid+"&waux=1"
}else
baseHtml="FrameType="+request.FrameType+"&ViewFkey="+request.ViewFkey+"&uid="+request.uid
}
function setUrl(docpath,reqObj) {
baseReq="FrameType="+request.FrameType+"&ViewFkey="+request.ViewFkey+"&uid="+request.uid
if (!reqObj || reqObj == "")
var HtmlRef=docpath+"?"+baseReq;
else
var HtmlRef=docpath+"?"+reqObj+"&"+baseReq;
// load_url("main",HtmlRef);
debug(HtmlRef);
return HtmlRef;
}
function getHtmlRef() {
return "FrameType="+request.FrameType+"&ViewFkey="+request.ViewFkey+"&uid="+request.uid
}
//
function Go_BaseFrame(FrameType,ViewFkey,MsgScroll,username) {
parent.document.location.href=entorno.DirBase+"/reinitial.html?FrameType="+FrameType+
"&ViewFkey="+ViewFkey+
"&MsgScroll="+MsgScroll+
"&username="+username
// var mainFrame=find_frame(top,"contents");
// mainFrame.document.f_contents.action=entorno.DirBase+"/ctasapagar.html?FrameType="+FrameType
// mainFrame.document.f_contents.submit();
}
function IniciaRequest(objeto) {
if (objeto == "us_" || objeto == "all" ) {
// user ->
// request.id
// request.login
// request.password
// request.firstname
// request.lastname
// request.fullname
// request.title
// request.phone
// request.email
// request.active
// request.status
// request.admin
// request.def_project
// request.def_category
}
if (objeto == "ac_" || objeto == "all" ) {
// aptecuentas ->
request.ac_nro_reg=0
request.ac_nro_lin=0
request.ac_cod_cta=""
request.acf_clave="";
request.acf_concepto="";
request.ac_importe=0
request.ac_tipo_apte="";
request.ac_fecha="";
}
if (objeto == "tc_" || objeto == "all" ) {
// traspaso_ctas ->
request.tc_cta_contable="";
request.tc_importe=0;
request.tc_es_nueva="N";
}
if (objeto == "pr_" || objeto == "all" ) {
// proveedores ->
request.pr_nif="";
request.pr_razon_social="";
request.pr_cta_contable="";
request.pr_cond_pago="";
request.pr_domicilio="";
request.pr_localidad="";
request.pr_cod_postal="";
request.pr_attn_envio="";
request.pr_direccion_envio="";
request.pr_localidad_envio="";
request.pr_cod_postal_envio="";
request.pr_telefono_1="";
request.pr_telefono_2="";
request.pr_fax="";
request.pr_e_mail="";
request.pr_observaciones="";
request.pr_expediente="";
request.pr_t_condpago="";
request.pr_t_localidad="";
request.pr_t_loc_envio="";
}
if (objeto == "ce_" || objeto == "all" ) {
// centros ->
request.ce_cod_centro="";
request.ce_cod_departamento="";
request.ce_descripcion="";
}
if (objeto == "cp_" || objeto == "all" ) {
// cond_pago ->
request.cp_cond_pago="";
request.cp_descripcion="";
request.cp_vencimiento=0
}
if (objeto == "pe_" || objeto == "all" ) {
// pedidos ->
request.pe_nro_pedido="";
request.pe_descripcion="";
request.pe_nif_proveedor="";
request.pe_cod_centro="";
request.pe_cond_pago="";
request.pe_fecha_pedido="";
request.pe_fecha_entrega="";
request.pe_importe=0;
request.pe_observaciones="";
request.pe_expediente="";
}
if (objeto == "ct_" || objeto == "all" ) {
// ctas_contables ->
request.ct_cta_contable="";
request.ct_descripcion="";
request.ct_es_nueva="";
}
if (objeto == "cv_" || objeto == "all" ) {
// ctas_contables ->
request.cv_cod_clave="";
request.cv_descripcion="";
}
if (objeto == "al_" || objeto == "all" ) {
// albalineas ->
request.al_nro_lin=0;
request.al_nro_reg="";
request.al_cantidad=0;
request.al_referencia="";
request.al_descripcion="";
request.al_precio_und=0;
}
if (objeto == "lo_" || objeto == "all" ) {
// localidades ->
request.lo_cod_localidad="";
request.lo_descripcion="";
}
if (objeto == "re_" || objeto == "all" ) {
// registros ->
request.rg_tipo_reg="";
request.rg_nro_reg=0;
}
if (objeto == "ab_" || objeto == "all" ) {
// albaranes ->
request.ab_nro_reg="";
request.ab_is_locked="N";
request.ab_fra_reg="";
request.ab_fecha_emision="";
request.ab_cod_centro="";
request.ab_nif=" ";
request.ab_por_reten=client.pa_reten_1;
request.ab_importe_reten=0;
request.ab_nro_pedido="";
request.ab_vto_jefe_obra="";
request.ab_vto_jefe_grupo="";
request.ab_vto_proveedor="";
request.ab_observaciones="";
request.ab_expediente="";
}
if (objeto == "af_" || objeto == "all" ) {
// albafras ->
request.af_nroreg_albafact="";
request.af_nroreg_factura="";
request.af_nroreg_albaran="";
request.af_observaciones="";
}
if (objeto == "ba_" || objeto == "all" ) {
// bancos ->
request.ba_cod_banco="";
request.ba_nombre="";
request.ba_domicilio="";
request.ba_localidad="";
request.ba_cod_postal="";
request.ba_entidad="";
request.ba_sucursal="";
request.ba_cod_control="";
request.ba_nro_cc="";
request.ba_nro_lins="";
request.ba_l_importe="";
request.ba_c_importe="";
request.ba_l_paguese="";
request.ba_c_paguese="";
request.ba_l1_nroletra="";
request.ba_c1_nroletra="";
request.ba_l2_nroletra="";
request.ba_c2_nroletra="";
request.ba_l_fecha="";
request.ba_c_fecha="";
request.ba_l_mes="";
request.ba_c_mes="";
request.ba_l_anno="";
request.ba_c_anno="";
request.ba_l1_firmado="";
request.ba_c1_firmado="";
request.ba_l2_firmado="";
request.ba_c2_firmado="";
request.ba_t1_firmado="";
request.ba_t2_firmado="";
}
if (objeto == "fa_" || objeto == "all" ) {
// facturas ->
request.fa_nro_reg="";
request.fa_nro_regn="";
request.fa_nro_regy="";
request.fa_is_locked="N";
request.fa_mes=NroFormat(HOY.getMonth()+1,"00");
request.fa_nro_fra="";
request.fa_f_emision="";
request.fa_f_recepcion="";
request.fa_f_pago="";
request.fa_tipo_fra=1;
request.fa_tipo_calc_iva=1;
request.fa_importe_total=0;
request.fa_nif="";
request.fa_cod_centro="";
request.fa_nro_pedido="";
request.fa_cond_pago="";
request.fa_tipo_doc_pago=1;
request.fa_nro_doc_pago="";
request.fa_f_emision_pago="";
request.fa_cod_localidad="";
request.fa_cod_banco="";
request.fa_base_1=0;
request.fa_por_ret1=0;
request.fa_ret_1=0;
request.fa_por_iva1=client.pa_iva_1;
request.fa_iva_1=0;
request.fa_base_2=0;
request.fa_por_ret2=0;
request.fa_ret_2=0;
request.fa_por_iva2=client.pa_iva_2;
request.fa_iva_2=0;
request.fa_base_3=0;
request.fa_por_ret3=0;
request.fa_ret_3=0;
request.fa_por_iva3=client.pa_iva_3;
request.fa_iva_3=0;
request.fa_canexen=0;
request.fa_base_imponible=0;
request.fa_tipo_retencion=1;
request.fa_tipo_deduccion="";
request.fa_deducciones=0;
request.fa_sin_pedido="";
request.fa_traspaso_gasto="N";
request.fa_traspaso_vto="N";
request.fa_traspaso_pago="N";
request.fa_nro_reg_vto="";
request.fa_vto_pago="";
request.fa_observaciones="";
request.fa_expediente="";
}
if (objeto == "acf_" || objeto == "all" ) {
// aptectasfra ->
request.acf_nro_reg="";
request.acf_nro_lin=0;
request.acf_tipolin="";
request.acf_cod_cta="";
request.acf_clave="";
request.acf_concepto="";
request.acf_importe=0;
request.acf_tipo_apte="";
request.acf_fecha="";
}
if (objeto == "pa_" || objeto == "all" ) {
request.pa_id = 1;
request.pa_nro_reg = "";
request.pa_longcta = 0;
request.pa_dia_pago_1 = 0;
request.pa_dia_pago_2 = 0;
request.pa_ex_dia_pago = "";
request.pa_iva_1 = 0;
request.pa_iva_2 = 0;
request.pa_reten_1 = 0;
request.pa_ctas_reten_1 = "";
request.pa_clave_reten_1 = "";
request.pa_reten_2 = 0;
request.pa_ctas_reten_2 = "";
request.pa_clave_reten_2 = "";
request.pa_ctas_iva = "";
request.pa_clave_iva = "";
request.pa_ctas_cont = "";
request.pa_clave_cont = "";
request.pa_ctas_comp = "";
request.pa_clave_comp = "";
request.pa_ctas_coniva = "";
request.pa_clave_coniva = "";
request.pa_ctas_siniva = "";
request.pa_clave_siniva = "";
request.pa_ctas_dev = "";
request.pa_clave_dev = "";
}
}
// ---------------------- Select Tablas ----------------------------------
function CursorTabla(CodTabla,clave,criterio,chk,forupdate)
{
if ( CodTabla == "pa" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_parametros=database.cursor("SELECT * FROM parametros WHERE "+ clave +criterio , forupdate );
status=c_parametros.next();
if ( chk == true )
DbsError(true,status);
}
if ( CodTabla == "acf" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_aptectasfra=database.cursor("SELECT * FROM aptectasfra WHERE "+ clave +criterio , forupdate );
// status=c_aptectasfra.next();
// if ( chk == true )
// DbsError(true,status);
}
if ( CodTabla == "ac" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_aptecuentas=database.cursor("SELECT * FROM aptecuentas WHERE "+ clave +criterio , forupdate );
if ( chk == true )
status=c_aptecuentas.next();
if ( chk == true )
DbsError(true,status);
}
if ( CodTabla == "tc" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_traspaso_ctas=database.cursor("SELECT * FROM traspaso_ctas WHERE "+ clave +criterio , forupdate );
status=c_traspaso_ctas.next();
if ( chk == true )
DbsError(true,status);
}
if ( CodTabla == "pr" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_proveedores=database.cursor("SELECT * FROM proveedores WHERE "+ clave +criterio , forupdate );
status=c_proveedores.next();
if ( chk == true )
DbsError(true,status);
}
if ( CodTabla == "ce" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_centros=database.cursor("SELECT * FROM centros WHERE "+ clave +criterio , forupdate );
status=c_centros.next();
if ( chk == true )
DbsError(true,status);
}
if ( CodTabla == "pl" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_plan_contable=database.cursor("SELECT * FROM plan_contable WHERE "+ clave +criterio , forupdate );
status=c_plan_contable.next();
if ( chk == true )
DbsError(true,status);
}
if ( CodTabla == "cp" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_cond_pago=database.cursor("SELECT * FROM cond_pago WHERE "+ clave +criterio , forupdate );
status=c_cond_pago.next();
if ( chk == true )
DbsError(true,status);
}
if ( CodTabla == "pe" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_pedidos=database.cursor("SELECT * FROM pedidos WHERE "+ clave +criterio , forupdate );
status=c_pedidos.next();
if ( chk == true )
DbsError(true,status);
}
if ( CodTabla == "lo" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_localidades=database.cursor("SELECT * FROM localidades WHERE "+ clave +criterio , forupdate );
status=c_localidades.next();
if ( chk == true )
DbsError(true,status);
}
if ( CodTabla == "fa" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_facturas=database.cursor("SELECT * FROM facturas WHERE "+ clave +criterio , forupdate );
status=c_facturas.next();
if ( chk == true )
DbsError(true,status);
}
if ( CodTabla == "ct" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_ctas_contables=database.cursor("SELECT * FROM ctas_contables WHERE "+ clave +criterio , forupdate );
status=c_ctas_contables.next();
if ( chk == true )
DbsError(true,status);
}
if ( CodTabla == "ba" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_bancos=database.cursor("SELECT * FROM bancos WHERE "+ clave +criterio , forupdate );
status=c_bancos.next();
if ( chk == true )
DbsError(true,status);
}
if ( CodTabla == "al" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_albalineas=database.cursor("SELECT * FROM albalineas WHERE "+ clave +criterio , forupdate );
if ( chk == true )
status=c_albalineas.next();
if ( chk == true )
DbsError(true,status);
}
if ( CodTabla == "cv" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_claves=database.cursor("SELECT * FROM claves WHERE "+ clave +criterio , forupdate );
status=c_claves.next();
if ( chk == true )
DbsError(true,status);
}
if ( CodTabla == "re" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_registro=database.cursor("SELECT * FROM registro WHERE "+ clave +criterio , forupdate );
status=c_registro.next();
if ( chk == true )
DbsError(true,status);
}
if ( CodTabla == "ab" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_albaranes=database.cursor("SELECT * FROM albaranes WHERE "+ clave +criterio , forupdate );
status=c_albaranes.next();
if ( chk == true )
DbsError(true,status);
}
if ( CodTabla == "af" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_albafras=database.cursor("SELECT * FROM albafras WHERE "+ clave +criterio , forupdate );
if ( chk == true )
status=c_albafras.next();
if ( chk == true )
DbsError(true,status);
}
if ( CodTabla == "pa" ) {
//Si se busca la fila ... usando la clave primaria de la relación
c_parametros=database.cursor("SELECT * FROM parametros WHERE "+ clave +criterio , forupdate );
status=c_parametros.next();
if ( chk == true )
DbsError(true,status);
}
}
function LoadHidden(htmlBaseRef) {
writeln('<INPUT type="hidden" NAME="FrameType" VALUE="'+request.FrameType+'" SIZE=1 maxlength=1 >');
writeln('<INPUT type="hidden" NAME="uid" VALUE="'+request.uid+'" SIZE=1 maxlength=1 >');
writeln('<INPUT type="hidden" NAME="ViewFkey" VALUE="'+request.ViewFkey+'" SIZE=1 maxlength=1 >');
writeln('<INPUT type="hidden" NAME="htmlBaseRef" VALUE="'+htmlBaseRef+'" SIZE=200>');
}
function ObjHeadBar(valor,texto,obj) {
writeln('<CENTER>');
writeln('<TABLE BORDER=6><TR>');
writeln(' <TD><A HREF="logout.html?bb=1" target="_top">');
writeln(' <IMG SRC="images/bb_logout.gif"');
writeln(' ALT="Logout" BORDER=0 HEIGHT=61 WIDTH=66></A></TD>');
writeln(' <TD ALIGN=LEFT>');
if ( obj != "rpt" ) {
if (!valor)
writeln("<INPUT type='submit' name='add' value='Confirmar'><BR>");
if (valor && request.nvo)
writeln("<INPUT type='submit' name='add' value='Confirmar'><BR>");
if (valor && !request.nvo && request.lock)
writeln("<INPUT type='submit' name='upd' value='Confirmar'><BR>");
if (valor && !request.nvo && !request.lock)
writeln("<INPUT type='submit' name='lock' value='Modificar'><BR>");
if ( request.ViewFkey == "S" && request.lock )
writeln("<INPUT type='button' name='ir' value='Ir a' onClick='Enfoca(this)' >");
if ( request.ViewFkey == "N" && request.lock )
writeln("<INPUT type='button' name='ver' value='Ver' onClick='FormPaint(this)'>");
}
if ( obj == "ab_" && request.lock) {
writeln("<INPUT type='button' name='linCta' value='Cta.' onClick='Enfoca(this)' >");
writeln("<INPUT type='button' name='linAlb' value='Línea' onClick='Enfoca(this)'>");
}
if ( obj == "fa_" && request.lock) {
writeln("<INPUT type='button' name='linCta' value='Cta.' onClick='Enfoca(\"linCta\")' >");
writeln("<INPUT type='button' name='linAlb' value='Alb.' onClick='Enfoca(\"linAlb\")'>");
}
writeln(' <A HREF="javascript:history.back()">');
writeln(' <IMG SRC="images/l_arrowg.gif" ALT="Volver" BORDER=0 HEIGHT=35 WIDTH=47></TD>');
writeln(' <TD><H1 ALIGN=CENTER><FONT SIZE=+3><FONT COLOR="#008000">');
writeln(' '+texto+'');
writeln(' </FONT><FONT COLOR="#FF00FF"></FONT></FONT></H1></TD>');
writeln(' <TD ALIGN=RIGHT>');
if ( obj != "rpt" ) {
if (request.lock)
writeln('<INPUT type="reset" value="Deshacer"><BR> ');
if (valor && !request.nvo )
writeln("<INPUT type='submit' name='del' value='Borrar'>");
}
writeln(' </TD><TD><A HREF="fr_main.html?goback=1" onClick="NetHelp(\'intro\')">');
writeln(' <IMG SRC="images/bb_help.gif" ALT="Ayuda" BORDER=0 HEIGHT=61 WIDTH=61></A></TD></TR>');
writeln('</TABLE></CENTER>');
writeln('<HR SIZE=3 WIDTH="100%">');
}
function QueryHeadBar(texto,criterio,obj) {
writeln('<CENTER>');
writeln('<TABLE BORDER=6>');
writeln(' <TR><TD ALIGN=LEFT>');
writeln(' <A HREF="logout.html?bb=1" target="_top">');
writeln(' <IMG SRC="images/bb_logout.gif"');
writeln(' ALT="Logout" BORDER=0 HEIGHT=61 WIDTH=66></A><BR></TD>');
writeln(' <TD ALIGN=LEFT>');
if ( obj != "rpt" ) {
if (client.acl != 1 && !request.waux)
writeln(' <INPUT type="submit" value="Alta">');
}
writeln(' <A HREF="javascript:history.back();history.back();">');
writeln(' <IMG SRC="images/l_arrowg.gif"');
writeln(' ALT="Volver" BORDER=0 HEIGHT=35 WIDTH=47><BR></A></TD>');
writeln(' <TD><H1 ALIGN=CENTER><FONT SIZE=+3><FONT COLOR="#008000">');
writeln(' '+texto+'</FONT><BR>');
writeln('<!-- <FONT COLOR="#FF00FF"> -->');
writeln(' <FONT SIZE=+2>'+criterio+'</FONT></FONT></H1></TD>');
writeln(' <TD ALIGN=RIGHT>');
writeln(' <A HREF="javascript:history.forward()">');
writeln(' <IMG SRC="images/r_arrowg.gif"');
writeln(' ALT="Volver" BORDER=0 HEIGHT=35 WIDTH=47></A></TD>');
writeln(' <TD ALIGN=RIGHT><BR>');
writeln(' <A HREF="fr_main.html?goback=1"');
writeln(' onClick="NetHelp(\'intro\')">');
writeln(' <IMG SRC="images/bb_help.gif"');
writeln(' ALT="Ayuda" BORDER=0 HEIGHT=61 WIDTH=61></A><BR></TD></TR>');
writeln('</TABLE></CENTER>');
writeln('<HR SIZE=3 WIDTH="100%">');
}
function execMainFrm(obj) {
var accion=obj.name;
var mainFrame=find_frame(top,"main");
var f_form=mainFrame.document.forms[0];
if ( accion == "add" ) {
if (mainFrame.Chek_fields(f_form) == true) {
f_form.action=f_form.htmlBaseRef.value+"&add=1";
f_form.submit();
}
}
if ( accion == "Actualizar" ) {
if (mainFrame.Chek_fields(f_form) == true) {
f_form.action=f_form.htmlBaseRef.value+"&upd=1";
f_form.submit();
}
}
if ( accion == "Modificar" ) {
f_form.action=f_form.htmlBaseRef.value+"&lock=true";
f_form.submit();
}
if ( accion == "Ir a" )
mainFrame.Enfoca("Ir a");
if ( accion == "Refrescar" ) {
f_form.action=f_form.htmlBaseRef.value+"&cookie=1&lock=true";
f_form.submit();
}
if ( accion == "Deshacer" )
f_form.reset();
if ( accion == "Borrar" ) {
f_form.action=f_form.htmlBaseRef.value+"&del=1";
f_form.submit();
}
if ( accion == "Cta." )
mainFrame.Enfoca("linCta");
if ( accion == "Alb." )
mainFrame.Enfoca("linAlb");
};
function ObjButtons(valor,texto,obj) {
writeln(' ndoc.close();');
writeln(' ndoc.open();');
writeln(' ndoc.clear();');
writeln(' ndoc.writeln(\'<HTML><HEAD></HEAD>\');');
// writeln(' ndoc.writeln(\'<SCRIPT SRC="global.js">\');');
// writeln(' ndoc.writeln(\'</SCRIPT>\');');
writeln(' ndoc.writeln(\'<BODY BACKGROUND="images/backgrnd.gif">\');');
writeln(' ndoc.writeln(\'<FORM NAME="f_buttons" METHOD="post" action="\'+formAction+\'">\');');
writeln(' ndoc.writeln(\'<CENTER>\');');
writeln(' ndoc.writeln(\'<TABLE BORDER=6><TR>\');');
writeln(' ndoc.writeln(\' <TD><A HREF="logout.html?bb=1" target="_top">\');');
writeln(' ndoc.writeln(\' <IMG SRC="images/bb_logout.gif"\');');
writeln(' ndoc.writeln(\' ALT="Logout" BORDER=0 HEIGHT=61 WIDTH=66></A></TD>\');');
writeln(' ndoc.writeln(\' <TD ALIGN=LEFT>\');');
if ( obj != "rpt" ) {
if (!valor)
writeln(' ndoc.writeln(\'<INPUT type="button" name="add" value="Confirmar" onClick="parent.execMainFrm(this)"><BR>\');');
if (valor && request.nvo)
writeln(' ndoc.writeln(\'<INPUT type="button" name="add" value="Confirmar" onClick="parent.execMainFrm(this)"><BR>\');');
if (valor && !request.nvo && request.lock)
writeln(' ndoc.writeln(\'<INPUT type="button" name="Actualizar" value="Confirmar" onClick="parent.execMainFrm(this)"><BR>\');');
if (valor && !request.nvo && !request.lock)
writeln(' ndoc.writeln(\'<INPUT type="button" name="Modificar" value="Modificar" onClick="parent.execMainFrm(this)"><BR>\');');
if ( request.ViewFkey == "S" && request.lock )
writeln(' ndoc.writeln(\'<INPUT type="button" name="Ir a" value="Ir a" onClick="parent.execMainFrm(this)">\');');
if ( request.ViewFkey == "N" && request.lock )
writeln(' ndoc.writeln(\'<INPUT type="button" name="Refrescar" value="Ver" onClick="parent.execMainFrm(this)"><BR>\');');
}
if ( obj == "ab_") {
writeln(' ndoc.writeln(\'<INPUT type="button" name="Cta." value="Cta." onClick="parent.execMainFrm(this)">\');');
writeln(' ndoc.writeln(\'<INPUT type="button" name="Linea" value="Línea" onClick="parent.execMainFrm(this)" >\');');
}
if ( obj == "fa_") {
writeln(' ndoc.writeln(\'<INPUT type="button" name="Cta." value="Cta." onClick="parent.execMainFrm(this)">\');');
writeln(' ndoc.writeln(\'<INPUT type="button" name="Alb." value="Alb." onClick="parent.execMainFrm(this)">\');');
}
// writeln(' ndoc.writeln(\' <A HREF="javascript:history.back()" target="_parent">\');');
// writeln(' ndoc.writeln(\' <IMG SRC="images/l_arrowg.gif" ALT="Volver" BORDER=0 HEIGHT=35 WIDTH=47></TD>\');');
writeln(' ndoc.writeln(\' <TD><H1 ALIGN=CENTER><FONT SIZE=+3><FONT COLOR="#008000">\');');
writeln(' ndoc.writeln(\' '+texto+'\');');
writeln(' ndoc.writeln(\' </FONT><FONT COLOR="#FF00FF"></FONT></FONT></H1></TD>\');');
writeln(' ndoc.writeln(\' <TD ALIGN=RIGHT>\');');
if ( obj != "rpt" ) {
if (request.lock)
writeln(' ndoc.writeln(\'<INPUT type="button" name="Deshacer" value="Deshacer" onClick="parent.execMainFrm(this)"><BR>\');');
if (valor && !request.nvo )
writeln(' ndoc.writeln(\'<INPUT type="button" name="Borrar" value="Borrar" onClick="parent.execMainFrm(this)">\');');
}
writeln(' ndoc.writeln(\' </TD><TD><A HREF="\'+formAction+\'&gofunc=Ayuda&valor=intro">\');');
// writeln(" ndoc.writeln(' </TD><TD><A HREF=\"fr_main.html?goback=1\" onClick=\"NetHelp(\\'intro\\')\">');");
writeln(' ndoc.writeln(\' <IMG SRC="images/bb_help.gif" ALT="Ayuda" BORDER=0 HEIGHT=61 WIDTH=61></A></TD></TR>\');');
writeln(' ndoc.writeln(\'</TABLE></CENTER></FORM>\');');
writeln(' ndoc.writeln(\'<HR SIZE=3 WIDTH="100%">\');');
writeln(' ndoc.close();');
}
function QueryButtons(texto,criterio,obj) {
writeln(' ndoc.close();');
writeln(' ndoc.open();');
writeln(' ndoc.clear();');
writeln(' ndoc.writeln(\'<HTML><HEAD></HEAD>\');');
writeln(' ndoc.writeln(\'<BODY BACKGROUND="images/backgrnd.gif">\');');
writeln(' ndoc.writeln(\'<FORM NAME="f_Querybuttons" METHOD="post" action="\'+formAction+\'">\');');
writeln(' ndoc.writeln(\'<CENTER>\');');
writeln(' ndoc.writeln(\'<TABLE BORDER=6><TR>\');');
writeln(' ndoc.writeln(\' <TD><A HREF="logout.html?bb=1" target="_top">\');');
writeln(' ndoc.writeln(\' <IMG SRC="images/bb_logout.gif"\');');
writeln(' ndoc.writeln(\' ALT="Logout" BORDER=0 HEIGHT=61 WIDTH=66></A></TD>\');');
writeln(' ndoc.writeln(\' <TD ALIGN=LEFT>\');');
if ( obj != "rpt" ) {
if (client.acl != 1 && !request.waux)
writeln(' ndoc.writeln(\' <INPUT type="submit" name="gofunc" value="Alta">\');');
}
// writeln(' ndoc.writeln(\' <A HREF="javascript:history.back()" target="_parent">\');');
// writeln(' ndoc.writeln(\' <IMG SRC="images/l_arrowg.gif" ALT="Volver" BORDER=0 HEIGHT=35 WIDTH=47></TD>\');');
writeln(' ndoc.writeln(\' <TD><H1 ALIGN=CENTER><FONT SIZE=+3><FONT COLOR="#008000">\');');
writeln(' ndoc.writeln(\' '+texto+'</FONT><BR>\');');
writeln(' ndoc.writeln(\'<!-- <FONT COLOR="#FF00FF"> -->\');');
writeln(' ndoc.writeln(\' <FONT SIZE=+2>'+criterio+'</FONT></FONT></H1></TD>\');');
writeln(' ndoc.writeln(\' <TD ALIGN=RIGHT>\');');
writeln(' ndoc.writeln(\' </TD><TD><A HREF="\'+formAction+\'&gofunc=Ayuda&valor=intro">\');');
// writeln(" ndoc.writeln(' </TD><TD><A HREF=\"fr_main.html?goback=1\" onClick=\"NetHelp(\\'intro\\')\">');");
writeln(' ndoc.writeln(\' <IMG SRC="images/bb_help.gif" ALT="Ayuda" BORDER=0 HEIGHT=61 WIDTH=61></A></TD></TR>\');');
writeln(' ndoc.writeln(\'</TABLE></CENTER></FORM>\');');
writeln(' ndoc.writeln(\'<HR SIZE=3 WIDTH="100%">\');');
writeln(' ndoc.close();');
}
function writeSignature(showfull) {
if (showfull == true) {
writeln('<CENTER><HR SIZE=3 WIDTH="100%">');
writeln('<TABLE BORDER=1 ALIGN=CENTER>');
writeln(' <CAPTION></CAPTION>');
writeln(' <TR>');
writeln(' <TD ALIGN=LEFT>');
writeln(' <BGCOLOR="#FFFFFF" >');
writeln(' <A HREF="http://ctasapagar">');
writeln(' <IMG SRC="images/SGRP.jpg" BORDER=0 HEIGHT=76 WIDTH=86>');
writeln(' </A>');
writeln(' </TD>');
writeln(' <TD><I><FONT COLOR="#FF0080"><FONT SIZE=+2><B>');
writeln(' <A HREF="fr_main.html">');
writeln(' Dpto. Cuentas a Pagar');
writeln(' </A></B> </FONT></FONT></I>');
writeln(' </TD>');
writeln(' </TR>');
writeln('</TABLE></CENTER>');
writeln('<HR SIZE=3 WIDTH="100%">');
}
writeln('<CENTER>');
writeln('<FONT SIZE=-1>');
writeln('<B>Contactar con</B>: <ctasapagar></FONT><FONT SIZE=+1>');
writeln('<A HREF="mailto:ctasapagar%3Csando_malaga@admisys.com%3E">');
writeln(' Departamento de Cuentas a Pagar<BR>');
writeln('</A>');
writeln('</FONT><FONT SIZE=-1>Copyright &copy; 1997 </FONT>');
writeln('<A HREF="mailto:info%3Csando_malaga@admisys.com%3E">');
writeln(' Construcciones SANDO SA');
writeln('</A>');
writeln('<FONT SIZE=-1>&amp; </FONT>');
writeln('<A HREF="mailto:info@admisys.com">');
writeln(' AdmiSys SL');
writeln('</A>');
writeln('<FONT SIZE=-1>');
writeln('<BR>Rev. 1.0 </FONT>');
writeln('<A HREF="mailto:webteam@admisys.com">');
writeln(' webteam@admisys.com');
writeln('</A>');
writeln('<FONT SIZE=-1><BR></CENTER>');
}
function LoadParametros() {
UnLoadParametros();
c_param = database.cursor("select * from parametros where id=1");
if (c_param.next()) {
client.pa_id = c_param.id;
client.pa_nro_reg = StringClip(false,c_param.nro_reg);
client.pa_longcta = c_param.longcta;
client.pa_dia_pago_1 = c_param.dia_pago_1;
client.pa_dia_pago_2 = c_param.dia_pago_2;
client.pa_ex_dia_pago = StringClip(false,c_param.ex_dia_pago);
client.pa_iva_1 = c_param.iva_1;
client.pa_iva_2 = c_param.iva_2;
client.pa_iva_3 = c_param.iva_3;
client.pa_reten_1 = c_param.reten_1;
client.pa_cta_reten_1 = StringClip(false,c_param.cta_reten_1);
client.pa_clave_reten_1 = StringClip(false,c_param.clave_reten_1);
client.pa_reten_2 = c_param.reten_2;
client.pa_cta_reten_2 = StringClip(false,c_param.cta_reten_2);
client.pa_clave_reten_2 = StringClip(false,c_param.clave_reten_2);
client.pa_cta_iva = StringClip(false,c_param.cta_iva);
client.pa_clave_iva = StringClip(false,c_param.clave_iva);
client.pa_cta_cont = StringClip(false,c_param.cta_cont);
client.pa_clave_cont = StringClip(false,c_param.clave_cont);
client.pa_cta_comp = StringClip(false,c_param.cta_comp);
client.pa_clave_comp = StringClip(false,c_param.clave_comp);
client.pa_cta_coniva = StringClip(false,c_param.cta_coniva);
client.pa_clave_coniva = StringClip(false,c_param.clave_coniva);
client.pa_cta_siniva = StringClip(false,c_param.cta_siniva);
client.pa_clave_siniva = StringClip(false,c_param.clave_siniva);
client.pa_cta_dev = StringClip(false,c_param.cta_dev);
client.pa_clave_dev = StringClip(false,c_param.clave_dev);
client.pa_cp_lock = StringClip(false,c_param.cp_lock);
}
c_param.close();
}
function SetParametros() {
writeln('// Variables de Entorno ');
writeln(' pa_id='+ client.pa_id + ' ;');
writeln(' pa_nro_reg='+ client.pa_nro_reg + ' ;');
writeln(' pa_nro_remesa='+ client.pa_nro_remesa + ' ;');
writeln(' pa_longcta='+ client.pa_longcta + ' ;');
writeln(' pa_dia_pago_1='+ client.pa_dia_pago_1 + ' ;');
writeln(' pa_dia_pago_2='+ client.pa_dia_pago_2 + ' ;');
writeln(' pa_ex_dia_pago='+ client.pa_ex_dia_pago + ' ;');
writeln(' pa_iva_1='+ client.pa_iva_1 + ' ;');
writeln(' pa_iva_2='+ client.pa_iva_2 + ' ;');
writeln(' pa_iva_3='+ client.pa_iva_3 + ' ;');
writeln(' pa_reten_1='+ client.pa_reten_1 + ' ;');
writeln(' pa_cta_reten_1="'+ client.pa_cta_reten_1 + '" ;');
writeln(' pa_clave_reten_1="'+ client.pa_clave_reten_1 + '" ;');
writeln(' pa_reten_2='+ client.pa_reten_2 + ' ;');
writeln(' pa_cta_reten_2="'+ client.pa_cta_reten_2 + '" ;');
writeln(' pa_clave_reten_2="'+ client.pa_clave_reten_2 + '" ;');
writeln(' pa_cta_iva="'+ client.pa_cta_iva + '" ;');
writeln(' pa_clave_iva="'+ client.pa_clave_iva + '" ;');
writeln(' pa_cta_cont="'+ client.pa_cta_cont + '" ;');
writeln(' pa_clave_cont="'+ client.pa_clave_cont + '" ;');
writeln(' pa_cta_comp="'+ client.pa_cta_comp + '" ;');
writeln(' pa_clave_comp="'+ client.pa_clave_comp + '" ;');
writeln(' pa_cta_coniva="'+ client.pa_cta_coniva + '" ;');
writeln(' pa_clave_coniva="'+ client.pa_clave_coniva + '" ;');
writeln(' pa_cta_siniva="'+ client.pa_cta_siniva + '" ;');
writeln(' pa_clave_siniva="'+ client.pa_clave_siniva + '" ;');
writeln(' pa_cta_dev="'+ client.pa_cta_dev + '" ;');
writeln(' pa_clave_dev="'+ client.pa_clave_dev + '" ;');
writeln(' pa_cp_lock="'+ client.pa_cp_lock + '" ;');
writeln(' baseHtml="'+ baseHtml + '" ;');
writeln('//');
}
function UnLoadParametros() {
client.pa_id = null;
client.pa_nro_reg = null;
client.pa_nro_remesa = null;
client.pa_longcta = null;
client.pa_dia_pago_1 = null;
client.pa_dia_pago_2 = null;
client.pa_ex_dia_pago = null;
client.pa_iva_1 = null;
client.pa_iva_2 = null;
client.pa_iva_3 = null;
client.pa_reten_1 = null;
client.pa_cta_reten_1 = null;
client.pa_calve_reten_1 = null;
client.pa_reten_2 = null;
client.pa_cta_reten_1 = null;
client.pa_calve_reten_1 = null;
client.pa_cta_iva = null;
client.pa_clave_iva = null;
client.pa_cta_cont = null;
client.pa_clave_cont = null;
client.pa_cta_comp = null;
client.pa_clave_comp = null;
client.pa_cta_siniva = null;
client.pa_clave_siniva = null;
client.pa_cta_coniva = null;
client.pa_clave_coniva = null;
client.pa_cta_dev = null;
client.pa_clave_dev = null;
client.pa_cp_lock = null;
}
function CtaNroPad(obj) {
if ( obj.value.length == 0 )
return;
var nro=parseInt(obj.value);
if ( nro+1 > 0 )
var c_nro=nro+"";
else {
alert("El dato: '"+obj.value+"' Contiene caracteres no válidos");
obj.focus();
return;
}
for (var j=c_nro.length ; j<pa_longcta ; j++ ) {
c_nro=c_nro+"0";
}
obj.value=c_nro.substring(0,pa_longcta);
if ( obj.value.length > pa_longcta ) {
alert("La cuenta: '"+obj.value+"' contiene más caracteres !!! ");
obj.focus();
}
}
function substCta(stringCta,formato) {
if (!formato)
return stringCta+" ";
var nro="";
nro=NroUnformat(stringCta+" ");
if ( nro.length > 0 )
c_nro=nro+" ";
else
return "0" ;
var cadena="";
var nrolon=c_nro.length;
var f_size=formato.length;
var f_char="";
for (var i=0; i < f_size ; i++) {
f_char=formato.substring(i,i+1);
// alert(cadena+"--"+i+"-"+c_nro.substring(i,i+1)+"--"+formato.substring(i,i+1))
if ( f_char == "?" )
cadena=cadena+c_nro.substring(i,i+1);
if ( f_char == "*" ) {
cadena=cadena+c_nro.substring(i,nrolon);
break;
}
if ( f_char != "*" && f_char != "?" )
cadena=cadena+f_char;
}
return cadena;
}
function getSeqPrt(nprinter) {
var nomFile=spoolpath+nprinter+"/seq";
var seqprtfile=new File(nomFile);
project.lock();
seqprtfile.open("r");
s_seq=seqprtfile.readln();
seqprtfile.close();
var n_seq=parseInt(s_seq);
if ( n_seq > 0 )
n_seq++;
else
n_seq=1;
seqprtfile.open("w");
seqprtfile.write(n_seq);
seqprtfile.close();
project.unlock();
return n_seq;
}
function skipTopPage(nrolinea,PaperLines){
for (nl=nrolinea ; nl <= PaperLines ; nl++)
fileRpt.writeln("<BR>");
}

126
error.html Normal file
View File

@ -0,0 +1,126 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Error de Conexi&oacute;n a la Base de Datos</TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (Win95; I) [Netscape]">
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
</HEAD>
<SERVER>
if (request.alert) {
//<!--
writeln("<SCRIPT LANGUAGE='JavaScript'>")
writeln("function Go_Location() {")
if (request.alert == 0 ){
redirect("logout.html?alert=0");
}
if (request.alert == 90 ){
writeln('alert("\\r ¡¡¡ Se desconoce el Usuario en la Base de Datos !!!\\r ")');
}
if (request.alert == 99 ){
writeln('alert("\\r ¡¡¡ No es posible utilizar las Páginas con otro Navegador\\r que no sea NETSCAPE NAVIGATOR 3 !!!\\r ")');
}
if (request.alert == 1 ){
writeln('alert("\\r ¡¡¡ Cursor No Abierto !!!\\r Operación no Realizada")');
}
if (request.alert == 2 ) {
writeln(' alert("\\r ¡¡¡ Ya existe un registro con esta clave !!! \\r Operación no Realizada")');
}
if (request.alert == 3 ) {
writeln(' alert("\\r ¡¡¡ La conversión de Fecha no es correcta!!! \\r Operación no Realizada")');
}
if (request.alert == 5 ) {
writeln(' alert("\\r ¡¡¡ No es posible realizar la inserción de Datos!!! \\r Operación no Realizada")');
}
if (request.alert == 6 ) {
writeln(' alert("\\r ¡¡¡ No es posible realizar la actualización de Datos!!! \\r Operación no Realizada")');
}
if (request.alert == 7 ) {
writeln(' alert("\\r ¡¡¡ No es posible realizar el borrado de Datos!!! \\r Operación no Realizada")');
}
if (request.alert == 8 ) {
writeln(' alert("\\r ¡¡¡ No es posible realizar la inserción de Datos!!! \\r Transacción no Realizada")');
}
if (request.alert == 9 ) {
writeln(' alert("\\r ¡¡¡ No es posible realizar la actualización de Datos!!! \\r Transacción no Realizada")');
}
if (request.alert == 10 ) {
writeln(' alert("\\r ¡¡¡ No es posible realizar el borrado de Datos!!! \\r Transacción no Realizada")');
}
if (request.alert == 11 ) {
writeln(' alert("\\r ¡¡¡ No es posible realizar la inserción de Líneas !!! \\r Transacción no Realizada")');
}
if (request.alert == 12 ) {
writeln(' alert("\\r ¡¡¡ No es posible realizar la inserción de Cuentas !!! \\r Transacción no Realizada")');
}
if (request.alert == 14 ) {
writeln(' alert("\\r ¡¡¡ No es posible realizar la inserción de Datos de Pago!!! \\r Transacción no Realizada")');
}
if (request.nro_reg) {
writeln(' alert("\\r ¡¡¡ Error en Factura Nro. Reg: '+request.nro_reg+' !!! \\r Operación no Realizada")');
}
writeln(' history.back(-2)')
writeln("}")
writeln("</SCRIPT>")
writeln('<BODY ONLOAD="Go_Location()" BACKGROUND="images/backgrnd.gif">');
} else
writeln('<BODY BACKGROUND="images/backgrnd.gif">');
//-->
</SERVER>
<H1>Gestor de Base de Datos: &nbsp;&nbsp;<B><BLINK><FONT COLOR="#FF0000"><FONT SIZE=+4>ERROR</FONT></FONT></BLINK></B></H1>
<P>
<HR>Par&aacute;metros de Conexi&oacute;n utilizados:</P>
<P>
<SERVER>
// write(" Status: <B>" + status + "</B>\n");
writeln("<p> Tipo de Servidor: <B>" + client.type + "</B><p>\n");
writeln("<p>Identificador del Servidor: <B>" + client.server + "</B><p>\n");
writeln("<p> Identificador Usuario ID: <B>" + client.db_id + "</B><p>\n");
// writeln(" Password: <B>" + client.password + "</B>\n");
writeln("<p> Password: <B>[not shown]</B><p>\n");
writeln("<p> Base de Datos: <B>" + client.database + "</B><p>\n");</SERVER></P>
<P>Comprobar los manuales y documentaci&oacute;n del Gestor de Base de
Datos para m&aacute;s informiaci&oacute;n acerca de los siguientes c&oacute;digos
de error:</P>
<P><!--
<TABLE BORDER=2 CELLPADDING=8 >
<CAPTION>
</CAPTION>
<TR>
<TD><B>Error Code</B></TD>
<TD><B>Mensaje de Error</B></TD>
</TR>
</TABLE>
-->
<SERVER>
if ( client.trans == true ) {
writeln("<p></B>Transacción Abortada </B><p>\n");
client.trans == false
}
writeln("<p>Status: " + client.status + "\n");
writeln("<p>DbStatus: " + client.dbstatus + "\n");
writeln("<p>Major Error: " + client.majorErrorCode + "\n");
writeln(client.majorErrorMessage + "</p>\n");
writeln("<p>Minor Error: " + client.minorErrorCode + "\n");
writeln(client.minorErrorMessage + "</p>\n");
</SERVER>
<!--
<h3>More Information</h3>
For more information, please see the
<a href="http://home.netscape.com/eng/LiveWire/relnotes/">LiveWire
Release Notes</a>. Also check the
<a href="http://help.netscape.com/">Netscape Technical Support Home
Page</a> for related Technical Notes and Frequently Asked Questions.
-->
<SERVER>writeSignature(false)</SERVER>
</BODY>
</HTML>

652
factura.js Normal file
View File

@ -0,0 +1,652 @@
// //
// JavaScript Functions //
// //
//////////////////////////////////////
function wfra(text){
writeln("w_outfra.document.write('"+text+"\\n');");
}
function InsFraLins() {
if ( !request.fa_nro_reg ) {
status=-1
return;
}
var nl=0;
var nrolineas=0;
var nroctas=0;
nrolineas=parseInt(request.nrolineas);
if ( nrolineas+1 > 1 ) {
for (nl=1;nl<=nrolineas;nl++) {
eval('if ( request.af_'+nl+'_nroreg_albaran && request.af_'+nl+'_nroreg_albaran.length > 0 && NroUnformat(request.af_'+nl+'_sumaCtas)!= 0) { '+
'status=database.execute("INSERT INTO albafras(" +'+
'" nroreg_albafact," +'+
'" nroreg_factura," +'+
'" nroreg_albaran," +'+
'" sumactas," +'+
'" observaciones ) VALUES (\'" + StringClip(true,request.af_'+nl+'_nroreg_albafact) + "\',\'" +'+
'StringClip(true,request.fa_nro_reg) + "\',\'"+'+
'StringClip(true,request.af_'+nl+'_nroreg_albaran) + "\',\'"+ '+
'NroUnformat(request.af_'+nl+'_sumaCtas) + "\',\'"+ '+
'StringClip(true,request.af_'+nl+'_observaciones) + "\')");}');
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect('error.html?alert=11')
}
DbsError(true,status);
eval('if ( request.af_'+nl+'_nroreg_albaran.length > 0 ) { '+
'status=database.execute("UPDATE albaranes SET" +'+
'" is_locked=\'S\',"+'+
'" fra_reg=\'"+'+
'StringClip(true,request.fa_nro_reg)+"\'"+'+
'" WHERE nro_reg = \'"+'+
'StringClip(true,request.af_'+nl+'_nroreg_albaran)+"\'")}')
// eval('if ( request.af_'+nl+'_nroreg_albaran && request.af_'+nl+'_nroreg_albaran.length > 0 ) { '+
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
eval("redirect('error.html?alert=14?key='+request.af_"+nl+"_nroreg_albaran)");
}
}
}
nroctas=parseInt(request.nroctas);
if ( nroctas+1 > 1 ) {
for (nl=1;nl<=nroctas;nl++) {
// ' request.acf_'+nl+'_concepto=StringClip(true,request.acf_'+nl+'_concepto)+request.fa_nro_reg.substring(4,10)+" "+request.fa_nro_fra+" "+request.fa_t_razon_social;}');
eval(' if ( request.acf_'+nl+'_concepto.substring(0,4) == " " ) {'+
' request.acf_'+nl+'_concepto=request.fa_nro_fra+" "+request.fa_nro_reg.substring(4,10)+" "+request.fa_t_razon_social;}');
eval(' if ( request.acf_'+nl+'_concepto.substring(0,1) == "-" ) {'+
' request.acf_'+nl+'_concepto="-"+request.fa_nro_fra+" "+request.fa_nro_reg.substring(4,10)+" "+request.fa_t_razon_social;}');
eval(' if ( request.acf_'+nl+'_concepto.substring(0,2) == "--" ) {'+
' request.acf_'+nl+'_concepto="--"+request.fa_nro_fra+" "+request.fa_nro_reg.substring(4,10)+" "+request.fa_t_razon_social;}');
eval(' if ( request.acf_'+nl+'_concepto.length < 4 ) {'+
' request.acf_'+nl+'_concepto=request.acf_'+nl+'_concepto.substring(0,2)+" "+request.fa_nro_fra+" "+request.fa_nro_reg.substring(4,10)+" "+request.fa_t_razon_social;}');
eval(' if ( request.acf_'+nl+'_importe+0 != 0 && request.acf_'+nl+'_cod_cta.length > 2 ) {'+
' status=database.execute("INSERT INTO aptectasfra(" + '+
'" nro_lin," + '+
'" nro_reg," +'+
'" tipolin," +'+
'" albareg," +'+
'" cod_cta," +'+
'" clave," +'+
'" concepto," +'+
'" importe," +'+
'" tipo_apte," +'+
'" fecha ) VALUES (\'" + StringClip(true,request.acf_'+nl+'_nro_lin) + "\',\'" + '+
'StringClip(true,request.fa_nro_reg) + "\',\'"+'+
'StringClip(true,request.acf_'+nl+'_tipolin) + "\',\'"+'+
'StringClip(true,request.acf_'+nl+'_albareg) + "\',\'"+'+
'StringClip(true,request.acf_'+nl+'_cod_cta) + "\',\'"+'+
'StringClip(true,request.acf_'+nl+'_clave) + "\',\'"+'+
'StringClip(true,request.acf_'+nl+'_concepto) + "\',\'"+'+
'NroUnformat(request.acf_'+nl+'_importe) + "\',\'"+'+
'StringClip(true,request.acf_'+nl+'_tipo_apte) + "\',\'"+'+
'StringClip(true,datetoString(HOY)) + "\')");}');
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect('error.html?alert=12')
}
DbsError(true,status);
}
}
}
function DelFraLins() {
status=database.execute("DELETE FROM albafras WHERE nroreg_factura = \'" + request.fa_nro_reg + "\'");
// if ( status != 0 ) {
// client.is_trans=false;
// database.rollbackTransaction();
// redirect('error.html')
// }
// DbsError(true,status);
status=database.execute("DELETE FROM aptectasfra WHERE nro_reg = \'" + request.fa_nro_reg + "\'");
// if ( status != 0 ) {
// client.is_trans=false;
// database.rollbackTransaction();
// redirect('error.html')
// }
// DbsError(true,status);
// Liberamos albaranes
status=database.execute("UPDATE albaranes SET" +
" is_locked='N',"+
" fra_reg=''"+
" WHERE fra_reg = '"+
StringClip(true,request.fa_nro_reg)+"'");
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
eval("redirect('error.html?alert=14?key='+request.af_"+nl+"_nroreg_albaran)");
}
}
function ctasAlbtoFra(ialb,icta) {
eval('CursorTabla("ab","nro_reg","=\'"+request.af_'+ialb+'_nroreg_albaran+"\'",true,"");');
// Asignamos a request todas las columnas necesarias para el form.
if ( c_albaranes.is_locked == "S" ) {
eval('request.af_'+ialb+'_nroreg_albaran="";');
eval('request.af_'+nl+'_observaciones="ALBARAN BLOQUEADO";');
eval('request.af_'+ialb+'_toblink="on";');
c_albaranes.close();
return;
}
var ab_nif="", ab_cod_centro="", ab_nro_pedido="";
ab_nif=StringClip(false,c_albaranes.nif);
ab_cod_centro=StringClip(false,c_albaranes.cod_centro);
ab_nro_pedido=StringClip(false,c_albaranes.nro_pedido);
if ( ab_nif != null && ab_nif != request.fa_nif )
eval('request.af_'+ialb+'_toblink="on";');
if ( ab_cod_centro != null && ab_cod_centro != request.fa_cod_centro )
eval('request.af_'+ialb+'_toblink="on";');
// if ( ab_nro_pedido != null && ab_nro_pedido != request.fa_nro_pedido )
// eval('request.af_'+ialb+'_toblink="on";');
eval('request.af_'+ialb+'_nif=ab_nif');
eval('request.af_'+ialb+'_nro_pedido=ab_nro_pedido');
eval('request.af_'+ialb+'_cod_centro=ab_cod_centro');
eval('CursorTabla("ac","nro_reg","=\'"+request.af_'+ialb+'_nroreg_albaran+"\'",false,"");');
var sumaCtas=0; lin=0;
eval ('if ( parseInt(request.acf_'+(icta+1)+'importe) == 0 ) { lin=1 } ');
icta=icta-lin;
var acumula=false;
while (c_aptecuentas.next()) {
// Si la Cuenta ya existe hay que acumular
acumula=false;
for (var i=1; i <= icta ; i++ ) {
eval(' if (request.acf_'+i+'_cod_cta==StringClip(true,c_aptecuentas.cod_cta) '+
' && request.acf_'+i+'_clave==StringClip(true,c_aptecuentas.clave) '+
' && request.acf_'+i+'_concepto==StringClip(true,c_aptecuentas.concepto) '+
' && request.acf_'+i+'_tipo_apte==StringClip(true,c_aptecuentas.tipo_apte) )'+
' { acumula=true }');
if ( acumula == true ) {
eval(' request.acf_'+i+'_importe=NroFormat('+
' parseFloat(NroUnformat(request.acf_'+i+'_importe))+c_aptecuentas.importe'+
',NF9);');
break;
}
}
if ( acumula == false ) { // No ha acumulado la cuenta del albarán !!!
icta++;
eval(' request.acf_'+icta+'_esnva="0";');
eval(' request.acf_'+icta+'_nro_lin='+icta+';');
eval(' request.acf_'+icta+'_albareg=request.af_'+ialb+'_nroreg_albaran;');
eval(' request.acf_'+icta+'_cod_cta=StringClip(true,c_aptecuentas.cod_cta);');
eval(' request.acf_'+icta+'_clave=StringClip(true,c_aptecuentas.clave);');
eval(' request.acf_'+icta+'_concepto=StringClip(true,c_aptecuentas.concepto);');
eval(' request.acf_'+icta+'_tipo_apte=StringClip(true,c_aptecuentas.tipo_apte);');
eval(' request.acf_'+icta+'_importe=NroFormat(c_aptecuentas.importe,NF9);');
if ( c_aptecuentas.concepto.length < 3 || StringClip(false,c_aptecuentas.concepto)==" " ) {
if ( c_aptecuentas.importe < 0 )
eval('request.acf_'+icta+'_concepto="A"');
if ( c_aptecuentas.importe >= 0 )
eval('request.acf_'+icta+'_concepto=""');
}
eval(' if (request.acf_'+icta+'_concepto == " ") {request.acf_'+icta+'_concepto=""}');
eval(' request.acf_'+icta+'_tipolin="A";');
}
if (c_aptecuentas.tipo_apte == "D" )
sumaCtas=sumaCtas+c_aptecuentas.importe;
if (c_aptecuentas.tipo_apte == "H" )
sumaCtas=sumaCtas-c_aptecuentas.importe;
}
c_aptecuentas.close()
if ( sumaCtas == 0 ) {
eval(' request.af_'+ialb+'_observaciones="¡¡ No existe o con Importe 0 !!";');
} else {
eval(' request.af_'+ialb+'_esnva="0";');
eval(' request.af_'+ialb+'_sumaCtas=NroFormat(sumaCtas,NF9);');
eval(' request.af_'+ialb+'_observaciones=StringClip(false,c_albaranes.observaciones);');
}
c_albaranes.close();
request.nroctas=icta+lin;
}
function scanClaveCta(icta) {
var f=document.f_factura;
// eval("var clave=f.acf_"+icta+"_clave.value;");
// alert("Clave:"+clave+" linea "+icta);
// eval("var importe=parseInt(NroUnforma(f.acf_"+icta+"_importe.value);");
var SumaIVA=0;
var cta="", tipoApte="", tipoLin="", TipoRet="", TipoFra="";
eval("SumaIVA=parseFloat(NroUnformat(f.fa_SumaIva.value));");
eval("cta=f.acf_"+icta+"_cod_cta.value;");
eval("tipoApte=get_value(\'select\',f.acf_"+icta+"_tipo_apte);");
eval("tipoLin=f.acf_"+icta+"_tipolin.value;");
TipoRet=get_value("select",f.fa_tipo_retencion);
TipoFra=get_value("select",f.fa_tipo_fra);
if ( tipoLin == "G" && SumaIVA == 0 ) { eval("f.acf_"+icta+"_clave.value=pa_clave_siniva;"); }
if ( tipoLin == "G" && SumaIVA > 0 ) { eval("f.acf_"+icta+"_clave.value=pa_clave_coniva;"); }
if ( tipoLin == "G" && SumaIVA < 0 ) { eval("f.acf_"+icta+"_clave.value=pa_clave_coniva;"); }
// if ( tipoApte == "D" ) { }
// if ( tipoApte == "H" ) { }
if ( TipoFra=="1") { // Albarán Interno
}
if ( TipoFra=="2") { // Dev. Retención
if ( tipoLin == "G" || tipoLin == "R" ) { eval("f.acf_"+icta+"_clave.value=pa_clave_dev;"); };
}
if ( TipoFra=="4") { // Sin Albaranes
}
if ( TipoRet=="0") { // Sin Retención
}
if ( TipoRet=="1") { // IRPF
if ( tipoLin == "G" || tipoLin == "R" ) { eval("f.acf_"+icta+"_clave.value=pa_clave_reten_1;"); }
}
if ( TipoRet=="2") { // Por Garantía
if ( tipoLin == "G" || tipoLin == "R" ) { eval("f.acf_"+icta+"_clave.value=pa_clave_reten_2;"); }
}
if ( TipoCalculo=="1") { // Sobre Base
} else { // Sobre Base - Retención
}
// eval("var clave=f.acf_"+icta+"_clave.value;");
// alert("Clave:"+clave);
}
function FraDocHtml(nro_reg) {
var s_seq=getSeqPrt(nprinter);
textoReqs=textoReqs+" "+s_seq;
var nomFile=spoolpath+nprinter+"/req_"+s_seq+".html"
fileRpt=new File(nomFile);
fileRpt.open("w");
fileRpt.writeln('<HTML><HEAD></HEAD>');
nrolin=1;
CursorTabla("fa","nro_reg","=\'"+nro_reg+"\'",true,"");
// Asignamos a request todas las columnas necesarias para el form.
request.fa_nro_reg=StringClip(false,c_facturas.nro_reg);
var lon=request.fa_nro_reg.length;
request.fa_nro_regn=request.fa_nro_reg.substring(4,lon);
request.fa_nro_regy=request.fa_nro_reg.substring(0,4);
request.fa_f_emision=datetoString(c_facturas.f_emision);
request.fa_f_recepcion=datetoString(c_facturas.f_recepcion);
request.fa_f_pago=datetoString(c_facturas.f_pago);
request.fa_f_emision_pago=datetoString(c_facturas.f_emision_pago);
request.fa_mes=StringClip(false,c_facturas.mes);
request.fa_nro_fra=StringClip(false,c_facturas.nro_fra);
request.fa_nif=StringClip(false,c_facturas.nif);
request.fa_cod_centro=StringClip(false,c_facturas.cod_centro);
request.fa_cond_pago=StringClip(false,c_facturas.cond_pago);
request.fa_tipo_calc_iva=StringClip(false,c_facturas.tipo_calc_iva);
request.fa_tipo_fra=StringClip(false,c_facturas.tipo_fra);
request.fa_tipo_doc_pago=StringClip(false,c_facturas.tipo_doc_pago);
request.fa_nro_doc_pago=StringClip(true,c_facturas.nro_doc_pago);
request.fa_cod_localidad=StringClip(false,c_facturas.cod_localidad);
request.fa_cod_banco=StringClip(true,c_facturas.cod_banco);
request.fa_base_1=NroFormat(c_facturas.base_1,NF11);
request.fa_por_ret1=NroFormat(c_facturas.por_ret1,NF2);
request.fa_ret_1=NroFormat(c_facturas.ret_1,NF9);
request.fa_por_iva1=NroFormat(c_facturas.por_iva1,NF2);
request.fa_iva_1=NroFormat(c_facturas.iva_1,NF9);
request.fa_base_2=NroFormat(c_facturas.base_2,NF11);
request.fa_por_ret2=NroFormat(c_facturas.por_ret2,NF2);
request.fa_ret_2=NroFormat(c_facturas.ret_2,NF9);
request.fa_por_iva2=NroFormat(c_facturas.por_iva2,NF2);
request.fa_iva_2=NroFormat(c_facturas.iva_2,NF9);
request.fa_base_3=NroFormat(c_facturas.base_3,NF11);
request.fa_por_ret3=NroFormat(c_facturas.por_ret3,NF2);
request.fa_ret_3=NroFormat(c_facturas.ret_3,NF9);
request.fa_por_iva3=NroFormat(c_facturas.por_iva3,NF2);
request.fa_iva_3=NroFormat(c_facturas.iva_3,NF9);
request.fa_canexen=NroFormat(c_facturas.canexen,NF11);
request.fa_SumaBase=NroFormat(c_facturas.base_1+c_facturas.base_2+c_facturas.base_3+c_facturas.canexen,NF11);
request.fa_SumaIva=NroFormat(c_facturas.iva_1+c_facturas.iva_2+c_facturas.iva_3,NF11);
request.fa_SumaRet=NroFormat(c_facturas.ret_1+c_facturas.ret_2+c_facturas.ret_3,NF11);
// if ( c_facturas.tipo_calc_iva == 2 )
fa_Totaf_1=c_facturas.base_1+c_facturas.iva_1-c_facturas.ret_1;
// else
// fa_Totaf_1=c_facturas.base_1+c_facturas.iva_1+c_facturas.ret_1;
// if ( c_facturas.tipo_calc_iva == 2 )
fa_Totaf_2=c_facturas.base_2+c_facturas.iva_2-c_facturas.ret_2;
// else
// fa_Totaf_2=c_facturas.base_2+c_facturas.iva_2+c_facturas.ret_2;
// if ( c_facturas.tipo_calc_iva == 2 )
fa_Totaf_3=c_facturas.base_3+c_facturas.iva_3-c_facturas.ret_3;
// else
// fa_Totaf_3=c_facturas.base_3+c_facturas.iva_3+c_facturas.ret_3;
var fa_Totex=c_facturas.canexen;
request.fa_Totaf_1=NroFormat(fa_Totaf_1,NF11);
request.fa_Totaf_2=NroFormat(fa_Totaf_2,NF11);
request.fa_Totaf_3=NroFormat(fa_Totaf_3,NF11);
request.fa_Totex=NroFormat(c_facturas.canexen,NF11);
request.fa_deducciones=NroFormat(c_facturas.deducciones,NF9);
request.fa_SumaImporte=NroFormat(fa_Totaf_1+fa_Totaf_2+fa_Totaf_3+fa_Totex,NF11);
request.fa_importe_total=NroFormat(fa_Totaf_1+fa_Totaf_2+fa_Totaf_3+fa_Totex-c_facturas.deducciones,NF11);
request.fa_tipo_retencion=StringClip(true,c_facturas.tipo_retencion);
request.fa_tipo_deduccion=StringClip(true,c_facturas.tipo_deduccion);
request.fa_nro_pedido=StringClip(false,c_facturas.nro_pedido);
request.fa_traspaso_gasto=StringClip(false,c_facturas.traspaso_gasto);
request.fa_traspaso_vto=StringClip(false,c_facturas.traspaso_vto);
request.fa_traspaso_pago=StringClip(false,c_facturas.traspaso_pago);
request.fa_nro_reg_pago=StringClip(false,c_facturas.nro_reg_pago);
request.fa_vto_pago=datetoString(c_facturas.vto_pago);
request.fa_observaciones=StringClip(false,c_facturas.observaciones);
request.fa_is_locked=StringClip(false,c_facturas.is_locked);
if (request.lock)
c_facturas.close();
if (request.fa_is_locked == "S" )
request.waux=8;
if (request.fa_cod_centro && request.fa_cod_centro != null) {
CursorTabla("ce","cod_centro","=\'"+StringClip(true,request.fa_cod_centro)+"\'",false,false);
request.fa_t_des_centro=c_centros.descripcion;
c_centros.close();
}
else
request.fa_t_des_centro="";
if (request.fa_nro_pedido && request.fa_nro_pedido != null) {
CursorTabla("pe","nro_pedido","=\'"+StringClip(true,request.fa_nro_pedido)+"\'",false,false);
request.fa_t_des_pedido=c_pedidos.descripcion;
if (request.fa_cond_pago.length==0)
request.fa_cond_pago=c_pedidos.cond_pago;
c_pedidos.close();
}
else
request.fa_t_des_pedido="";
if (request.fa_nif && request.fa_nif != null ) {
CursorTabla("pr","nif","=\'"+StringClip(true,request.fa_nif)+"\'",false,false);
request.fa_t_razon_social=StringClip(false,c_proveedores.razon_social);
if ( request.fa_t_razon_social == " " ) {
request.fa_t_razon_social="NO EXISTE";
request.fa_cta_contable="";
}
else {
request.fa_cta_contable=StringClip(false,c_proveedores.cta_contable);
if (request.fa_cond_pago.length==0 || request.fa_cond_pago==client.pa_cp_lock)
request.fa_cond_pago=c_proveedores.cond_pago;
}
c_proveedores.close();
}
else {
request.fa_t_razon_social="";
request.fa_cta_contable="";
}
if (request.fa_cond_pago && request.fa_cond_pago != null) {
CursorTabla("cp","cond_pago","=\'"+StringClip(true,request.fa_cond_pago)+"\'",false,false);
request.fa_t_condpago=c_cond_pago.descripcion;
request.fa_cp_vto=c_cond_pago.vencimiento;
c_cond_pago.close();
}
else {
request.fa_cp_vto=0
request.fa_t_condpago="";
}
if (request.fa_cod_banco && request.fa_cod_banco != null) {
CursorTabla("ba","cod_banco","=\'"+StringClip(true,request.fa_cod_banco)+"\'",false,false);
request.fa_t_nombre_banco=c_bancos.nombre;
c_bancos.close();
}
else
request.fa_t_nombre_banco="";
fileRpt.writeln('<CENTER><TABLE BORDER=0 ALIGN=CENTER CELLSPACING=0 CELLPADDING=4><TR>');
fileRpt.writeln('<TR><TD ALIGN=RIGHT><B> Nro.Reg.: </B>');
fileRpt.writeln('<FONT COLOR="#800040"><B>'+request.fa_nro_regn+'/'+request.fa_nro_regy+'</B></FONT></TD></FONT>');
if ( request.fa_is_locked == "S" )
fileRpt.writeln('<FONT COLOR="#800040">Bloqueada:<B>'+request.fa_is_locked+'</FONT></TD></FONT></TR>');
fileRpt.writeln('<TD ALIGN=RIGHT><B>Contabilizado:</B>');
fileRpt.writeln('<FONT COLOR="#800040"><B>'+request.fa_mes+'</B></FONT></TD></TR>');
nrolin++;
fileRpt.writeln('<TD ALIGN=RIGHT><B>Nro. Fra.:</B>');
fileRpt.writeln('<FONT COLOR="#800040"><B>'+request.fa_nro_fra+'</B></FONT></TD>');
nrolin++;
fileRpt.writeln('<TR><TD ALIGN=RIGHT><B> N.I.F. </B>');
fileRpt.writeln('<FONT COLOR="#800040"><B>'+request.fa_nif+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.fa_t_razon_social+'</FONT>');
nrolin++;
fileRpt.writeln('<TR><TD ALIGN=RIGHT><B>Centro</B>');
fileRpt.writeln('<FONT COLOR="#800040"><B>'+request.fa_cod_centro+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.fa_t_des_centro+'</FONT></TD>');
nrolin++;
fileRpt.writeln('<TR><TD ALIGN=RIGHT><B>Pedido</B>');
fileRpt.writeln('<FONT COLOR="#800040"><B>'+request.fa_nro_pedido+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.fa_t_des_pedido+'</FONT></TD>');
nrolin++;
fileRpt.writeln('<TR><TD ALIGN=RIGHT><B>C.Pago</B>');
fileRpt.writeln('<FONT COLOR="#800040"><B>'+request.fa_cond_pago+'</B></FONT></TD>');
fileRpt.writeln('<TD><FONT COLOR="#800040">'+request.fa_t_condpago+'</FONT></TD></TR>');
nrolin++;
fileRpt.writeln('<TD ALIGN=RIGHT><B>Fecha Emisión:</B>');
fileRpt.writeln('<FONT COLOR="#800040"><B>'+request.fa_f_emision+'</FONT></TD></FONT></TR>');
nrolin++;
fileRpt.writeln('<TD ALIGN=RIGHT><B>Fecha Recepción:</B>');
fileRpt.writeln('<FONT COLOR="#800040"><B>'+request.fa_f_recepcion+'</FONT></TD></FONT>');
fileRpt.writeln('<TD ALIGN=RIGHT><B>Fecha Pago:</B>');
fileRpt.writeln('<FONT COLOR="#800040"><B>'+request.fa_f_pago+'</FONT></TD></FONT></TR>');
nrolin++;
fileRpt.writeln('<TR><TD ALIGN=RIGHT><B>Tipo de Factura:</B>');
if (request.fa_tipo_fra=="1")
fileRpt.writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> De Albarán Interno </B></FONT>');
if (request.fa_tipo_fra=="2")
fileRpt.writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Devolución Retención </B></FONT>');
if (request.fa_tipo_fra=="4")
fileRpt.writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Sin Albaranes </B></FONT>');
nrolin++;
fileRpt.writeln('<TR><TD ALIGN=RIGHT><B>Retenciones:</B>');
if (request.fa_tipo_retencion=="0")
fileRpt.writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Sin Retencion </B></FONT>');
if (request.fa_tipo_retencion=="1")
fileRpt.writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> I.R.P.F. </B></FONT>');
if (request.fa_tipo_retencion=="2")
fileRpt.writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Por Garantía </B></FONT>');
fileRpt.writeln('<INPUT TYPE="hidden" NAME="fa_tipo_retencion" VALUE="'+request.fa_tipo_retencion+'"></TD>');
nrolin++;
fileRpt.writeln('<TR><TD ALIGN=RIGHT><B>Cálculo IVA:</B>');
if (request.fa_tipo_calc_iva=="1")
fileRpt.writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Sobre Base </B></FONT>');
else
fileRpt.writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Sobre Base - Retención </B></FONT>');
fileRpt.writeln('<INPUT TYPE="hidden" NAME="fa_tipo_calc_iva" VALUE="'+request.fa_tipo_calc_iva+'"></TD>');
nrolin++;
fileRpt.writeln('</TABLE>');
fileRpt.writeln('<CENTER>');
fileRpt.writeln('<TABLE BORDER='+request.borde+' CELLSPACING=0 CELLPADDING=4>');
fileRpt.writeln('<TR>');
fileRpt.writeln('<TD><B>Lin</B></TD>');
fileRpt.writeln('<TD><B> Base Imponible </B> </TD>');
fileRpt.writeln('<TD><B>%Ret</B></TD>');
fileRpt.writeln('<TD ALIGN=CENTER><B> Imp. Ret </B> </TD>');
fileRpt.writeln('<TD><B>%IVA</B></TD>');
fileRpt.writeln('<TD ALIGN=CENTER><B> Imp. IVA </B> </TD>');
fileRpt.writeln('<TD ALIGN=CENTER><B>T O T A L</B> </TD>');
fileRpt.writeln('</TR><TR>');
nrolin++;
fileRpt.writeln('<TR><TD><b>1.-</b></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_base_1+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_por_ret1+'</FONT></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_ret_1+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_por_iva1+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_iva_1+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_Totaf_1+'</B></FONT></TD>');
fileRpt.writeln('</TR><TR>');
nrolin++;
fileRpt.writeln('<TD><b>2.-</b></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_base_2+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_por_ret2+'</FONT></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_ret_2+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_por_iva2+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_iva_2+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_Totaf_2+'</B></FONT></TD>');
fileRpt.writeln('</TR><TR>');
nrolin++;
fileRpt.writeln('</TR><TR><TD><b>3.-</b></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_base_3+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_por_ret3+'</FONT></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_ret_3+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_por_iva3+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_iva_3+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_Totaf_3+'</B></FONT></TD>');
fileRpt.writeln('</TR><TR>');
nrolin++;
fileRpt.writeln('<TD><b>Ex.</b></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_canexen+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=CENTER>---</TD><TD ALIGN=CENTER>---------</TD><TD ALIGN=CENTER>---</TD><TD ALIGN=CENTER>---------</TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_Totex+'</B></FONT></TD>');
fileRpt.writeln('</TR><TR>');
nrolin++;
fileRpt.writeln('<TD><b>Tot.</b><TD');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_SumaBase+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=CENTER>---</TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_SumaRet+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=CENTER>---</TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_SumaIva+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_SumaImporte+'</B></FONT></TD>');
fileRpt.writeln('</TR><TR>');
nrolin++;
fileRpt.writeln('<TD><B>Ded:</B></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_tipo_deduccion+'</FONT></FONT></TD>');
fileRpt.writeln('<TD ALIGN=CENTER>---</TD><TD ALIGN=CENTER>---------</TD><TD ALIGN=CENTER>---</TD><TD ALIGN=CENTER>---------</TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_deducciones+'</FONT></TD></FONT></TR>');
fileRpt.writeln('</TR><TR>');
nrolin++;
fileRpt.writeln('<TD><b>Totales</b></TD>');
fileRpt.writeln('<TD></TD>');
fileRpt.writeln('<TD ALIGN=CENTER>---</TD><TD ALIGN=CENTER>---------</TD><TD ALIGN=CENTER>---</TD><TD ALIGN=CENTER>---------</TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+request.fa_importe_total+'</B></FONT></TD>');
fileRpt.writeln('</TR></TABLE>');
nrolin++;
fileRpt.writeln('<A NAME="lin-ctas"><CENTER><H2><FONT COLOR="#800040"> Apuntes Contables </FONT></H2></CENTER><A>');
fileRpt.writeln('<TABLE BORDER='+request.borde+' ALIGN=CENTER CELLSPACING=0 CELLPADDING=4>');
nrolin++;
fileRpt.writeln('<TR><TD ALIGN=CENTER><B>N.</B> </TD>');
fileRpt.writeln('<TD ALIGN=CENTER><B>Cuenta</B></TD>');
fileRpt.writeln('<TD ALIGN=CENTER><B>T&iacute;tulo Cuenta</B></TD>');
fileRpt.writeln('<TD ALIGN=CENTER><B>Debe</B> </TD>');
fileRpt.writeln('<TD ALIGN=CENTER><B>Haber</B> </TD>');
fileRpt.writeln('<TD><B>Clave</B></TD>');
fileRpt.writeln('<TD ALIGN=CENTER><B>Concepto</B> </TD>');
var lin=0;
CursorTabla("acf","nro_reg","=\'"+c_facturas.nro_reg+"\' order by nro_lin ",false,"");
var SumaDebe=0;
var SumaHaber=0;
request.nroctas=0;
nl=0;
while (c_aptectasfra.next()) {
request.nroctas=c_aptectasfra.nro_lin;
nro=c_aptectasfra.importe;
nl=request.nroctas
// if ( nro == 0 && nl < 10 ) {
//fileRpt.writeln("</TR>");
// continue;
// }
lin++;
if ( nrolin+1 > request.maxLins ) {
skipTopPage(nrolin,request.maxLins);
nrolin=0;
}
nrolin++;
fileRpt.writeln('<TR><TD><FONT COLOR="#800040"><B>'+c_aptectasfra.nro_lin+'</B></FONT>')
// var albareg=c_aptectasfra.albareg;
fileRpt.writeln('<TD ALIGN=CENTER>'+c_aptectasfra.cod_cta+'<FONT COLOR="#800040"><B></TD>');
valor=c_aptectasfra.cod_cta;
if (valor != " " && valor != "" && valor != "null" ) {
CursorTabla("ct","cta_contable","=\'"+StringClip(true,valor)+"\'",false,false);
texto=StringClip(true,c_ctas_contables.descripcion);
c_ctas_contables.close();
}
else {
texto=" "
}
fileRpt.writeln('<TD><FONT COLOR="#800040">'+texto+'</FONT></TD>');
if (c_aptectasfra.tipo_apte == "H") {SumaHaber=SumaHaber+nro} else {SumaDebe=SumaDebe+nro};
if (c_aptectasfra.tipo_apte == "H") {fileRpt.writeln('<TD ALIGN=CENTER>-</TD>')};
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+NroFormat(c_aptectasfra.importe,NF9)+'</B></FONT></TD>');
if (c_aptectasfra.tipo_apte == "D") {fileRpt.writeln('<TD ALIGN=CENTER>-</TD>')};
fileRpt.writeln('<TD ALIGN=CENTER>'+c_aptectasfra.clave+'<FONT COLOR="#800040"><B></TD>');
fileRpt.writeln('<TD ALIGN=CENTER>'+c_aptectasfra.concepto+'<FONT COLOR="#800040"><B></TD>');
fileRpt.writeln("</TR>");
}
// var acf_totalsaldo=NroFormat(SumaDebe-SumaHaber+" ",NF11);
c_aptectasfra.close();
nrolin++;
fileRpt.writeln('<TD ALIGN=CENTER>-</TD><TD ALIGN=CENTER>-</TD>');
fileRpt.writeln('<TD ALIGN=CENTER><FONT COLOR="#800040"><B>Totales ... </B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+NroFormat(SumaDebe+" ",NF11)+'</FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+NroFormat(SumaHaber+" ",NF11)+'</FONT></TD>');
fileRpt.writeln('<TD ALIGN=CENTER>-</TD><TD ALIGN=CENTER>-</TD>');
fileRpt.writeln('</TR></TABLE>');
fileRpt.writeln('<INPUT TYPE="hidden" NAME="nrolineas" VALUE="'+request.nrolineas+'" SIZE=2 >');
nrolin++;
fileRpt.writeln('<A NAME="lin-factura"><CENTER><H2><FONT COLOR="#800040"> Albaranes </FONT></H2></CENTER></A>');
nrolin++;
fileRpt.writeln('<TABLE BORDER='+request.borde+' ALIGN=CENTER CELLSPACING=0 CELLPADDING=4>');
fileRpt.writeln('<TR><TD ALIGN=CENTER><B>N.</B> </TD>');
fileRpt.writeln('<TD ALIGN=CENTER><B>Nro.Reg </B></TD> ');
fileRpt.writeln('<TD ALIGN=CENTER><B>Suma Ctas.</B></TD>');
fileRpt.writeln('<TD ALIGN=CENTER><B>O b s e r v a c i o n e s</B> </TD>');
fileRpt.writeln('</TR>');
CursorTabla("af","nroreg_factura","=\'"+c_facturas.nro_reg+"\'",false,"");
var sumalbs=0;
request.nrolineas=0;
while (c_albafras.next()) {
request.nrolineas++;
sumalbs=sumalbs+parseFloat(c_albafras.sumactas);
nrolin++;
fileRpt.writeln('<TR><TD><FONT COLOR="#800040">');
fileRpt.writeln('<B>'+c_albafras.nroreg_albafact+'</B></FONT>');
fileRpt.writeln('</TD>');
fileRpt.writeln('<TD><FONT COLOR="#800040"><B>'+c_albafras.nroreg_albaran+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+NroFormat(c_albafras.sumactas,NF9)+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+c_albafras.observaciones+'</B></FONT></TD>');
fileRpt.writeln('</TR>');
}
c_albafras.close()
nrolin++;
fileRpt.writeln('<TR><TD></TD>');
fileRpt.writeln('<TD>Total:</TD>');
fileRpt.writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>'+NroFormat(sumalbs,NF9)+'</B></FONT></TD>');
fileRpt.writeln('<TD></TD>');
fileRpt.writeln('</TABLE>');
// if (request.f_formato=="documento") {
fileRpt.writeln('</TR></TABLE></CENTER>');
fileRpt.writeln('</BODY>');
fileRpt.writeln('</HTML>');
fileRpt.close();
return nrolin;
// }
nrolin++;
fileRpt.writeln('<A NAME="pago"><CENTER><H2><FONT COLOR="#800040"> Datos de Pago </FONT></H2></CENTER><A>');
fileRpt.writeln('<TABLE BORDER='+request.borde+' ALIGN=CENTER CELLSPACING=0 CELLPADDING=4>');
nrolin++;
fileRpt.writeln('<TR><TD ALIGN=RIGHT><B> Banco: </B>');
fileRpt.writeln('<FONT COLOR="#800040"><B>'+request.fa_cod_banco+'</B></FONT></TD>');
fileRpt.writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.fa_t_nombre_banco+'</FONT></TD>');
nrolin++;
fileRpt.writeln('<TR><TD ALIGN=RIGHT><B>Localidad:</B></TD><TD>');
fileRpt.writeln('<FONT COLOR="#800040"><B>'+request.fa_cod_localidad+'</FONT></TD></TR>');
nrolin++;
fileRpt.writeln('<TR><TD ALIGN=RIGHT><B>Fecha Emisión:</B></TD><TD>');
fileRpt.writeln('<FONT COLOR="#800040"><B>'+request.fa_f_emision_pago+'</FONT></FONT></TR>');
nrolin++;
fileRpt.writeln('<TR><TD ALIGN=RIGHT><B>Tipo Doc. Pago:</B>');
if (request.fa_tipo_doc_pago=="1")
fileRpt.writeln('<FONT COLOR="#800040"><B> Pagaré </B></FONT>');
if (request.fa_tipo_doc_pago=="2")
fileRpt.writeln('<FONT COLOR="#800040"><B> Talón </B></FONT>');
if (request.fa_tipo_doc_pago=="3")
fileRpt.writeln('<FONT COLOR="#800040"><B> Compensación </B></FONT>');
if (request.fa_tipo_doc_pago=="4")
fileRpt.writeln('<FONT COLOR="#800040"><B> Domiciliación </B></FONT>');
fileRpt.writeln('<INPUT TYPE="hidden" NAME="fa_tipo_doc_pago" VALUE="'+request.fa_tipo_doc_pago+'"></TD>');
fileRpt.writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.fa_nro_doc_pago+'</FONT></FONT></TD></TR>');
nrolin++;
fileRpt.writeln('<TR><TD ALIGN=RIGHT><B>Vencimiento:</B></TD><TD>');
fileRpt.writeln('<FONT COLOR="#800040"><B>'+request.fa_vto_pago+'</FONT></TD></FONT></TR>');
fileRpt.writeln('</TR></TABLE>');
fileRpt.writeln('<A NAME="pie-factura"><CENTER><H2><FONT COLOR="#800040"> Notas </FONT></H2></CENTER></A>');
fileRpt.writeln('<TABLE BORDER=1 ALIGN=CENTER>');
nrolin++;
fileRpt.writeln('<TR> <TD ALIGN=RIGHT><B>Observaciones: </B></TD>');
fileRpt.writeln('<FONT COLOR="#800040"><TD ALIGN=LEFT> <TEXTAREA NAME="fa_observaciones" ROWS=4 COLS=30 SIZE=30 maxlength=30 WRAP="virtual">'+request.fa_observaciones+'</TEXTAREA> </TD> </TR>');
fileRpt.writeln('<TD ALIGN=RIGHT><B>Traspaso Contable:</B></TD>');
fileRpt.writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.fa_traspaso_ctable+'</B></FONT></TD></TR>');
nrolin++;
fileRpt.writeln('<TR><TD ALIGN=RIGHT><B>Traspaso de Pago:</B>');
fileRpt.writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.fa_traspaso_pago+'</B></FONT></TD></TR>');
nrolin++;
fileRpt.writeln('<TR><TD ALIGN=RIGHT><B>Aptes.Pago</B></TD>');
fileRpt.writeln('<TD><FONT COLOR="#800040"><B>'+request.fa_nro_reg_pago+'</B></FONT></TD>');
nrolin++;
fileRpt.writeln('<TR><TD ALIGN=RIGHT><B>Expediente:</B></TD>');
fileRpt.writeln('<TD><FONT COLOR="#800040"><B>'+request.fa_expediente+'</B></FONT></TD></TR>');
fileRpt.writeln('</TR></TABLE></CENTER>');
fileRpt.writeln('</BODY>');
fileRpt.writeln('</HTML>');
fileRpt.close();
return nrolin;
}

27
fr_botleft.html Normal file
View File

@ -0,0 +1,27 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE></TITLE>
<META NAME="Author" CONTENT="">
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (WinNT; I) [Netscape]">
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
</HEAD>
<BODY BACKGROUND="images/backgrnd.gif">
<FORM NAME="buttonbar">
<LEFT>
<SERVER>
if (request.FrameType == "F") {
writeln('<INPUT TYPE="button" NAME="LeftFrame" VALUE="Lateral"');
writeln(' OnClick="Go_BaseFrame(\'L\')">');
writeln('<INPUT TYPE="button" NAME="TopFrame" VALUE="Cabecera"');
writeln(' OnClick="Go_BaseFrame(\'C\')">');
}
</SERVER>
</FORM>
</BODY>
</HTML>

22
fr_botright.html Normal file
View File

@ -0,0 +1,22 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE></TITLE>
<META NAME="Author" CONTENT="">
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (WinNT; I) [Netscape]">
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
</HEAD>
<BODY BACKGROUND="images/backgrnd.gif">
<P><!--
<a href="fr_botright.html" onClick="loadHelp()"><img src="images/bb_help.gif" border="0" alt="Help"></a>
-->
<A HREF="fr_botright.html" onClick="NetHelp('intro')"><IMG SRC="images/bb_help.gif" ALT="Ayuda" BORDER=0 HEIGHT=61 WIDTH=61></A>
<A HREF="logout.html" target="_top"><IMG SRC="images/bb_logout.gif" ALT="Logout" BORDER=0 HEIGHT=61 WIDTH=66></A>
</P>
</BODY>
</HTML>

13
fr_bottom.html Normal file
View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<SCRIPT SRC="global.js">
</SCRIPT>
<HTML>
<HEAD>
<TITLE>Bottom Navigation Bar Frame in FrameSet</TITLE>
<META NAME="FORMATTER" CONTENT="Microsoft FrontPage 1.1">
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (WinNT; I) [Netscape]">
</HEAD>
<BODY BACKGROUND="images/backgrnd.gif">
<SERVER>writeSignature(false)</SERVER>
</BODY>
</HTML>

73
fr_conten.html Normal file
View File

@ -0,0 +1,73 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Table of Contents Frame in FrameSet</TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (WinNT; I) [Netscape]">
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
</HEAD>
<BODY BACKGROUND="images/backgrnd.gif">
<SERVER>
var baseHtml="frame";
dbAcl();
writeln('<P><BASE target="main"></P>');
writeln('<TABLE BORDER=4 ALIGN=CENTER CELLSPACING=4 CELLPADDING=4>');
writeln('<TR><TD><B><A HREF="g_listados.html?'+baseHtml+'">Listados</A></B></TD></TR>');
writeln('<TR><TD><B><A HREF="g_factura.html?'+baseHtml+'">Facturas</A></B></TD></TR>');
writeln('<TR><TD><B><A HREF="g_albaran.html?'+baseHtml+'">Albaranes</A></B></TD></TR>');
writeln('<TR><TD><B><A HREF="g_proveedor.html?'+baseHtml+'">Proveedores</A></B></TD></TR>');
writeln('<TR><TD><B><A HREF="g_pedido.html?'+baseHtml+'">Pedidos</A></B></TD></TR>');
writeln('<TR><TD><B><A HREF="g_centro.html?'+baseHtml+'">Centros</A></B></TD></TR>');
writeln('<TR><TD><B><A HREF="g_ctascont.html?'+baseHtml+'">Cuentas</A></B></TD></TR>');
writeln('<TR><TD><B><A HREF="g_clave.html?'+baseHtml+'">Claves</A></B></TD></TR>');
writeln('<TR><TD><B><A HREF="g_condpago.html?'+baseHtml+'">Cond.Pago</A></B></TD></TR>');
writeln('<TR><TD><B><A HREF="g_banco.html?'+baseHtml+'">Bancos</A></B></TD></TR>');
writeln('<TR><TD><B><A HREF="g_localidad.html?'+baseHtml+'">Localidades</A></B></TD></TR>');
writeln('<TR><TD><B><A HREF="g_vto.html?'+baseHtml+'">Vencimientos</A></B></TD></TR>');
if (request.uid== "100001") {
writeln('<TR><TD><B><A HREF="g_docpago.html?pa_id=1&'+baseHtml+'">Doc. Pago</A></B></TD></TR>');
writeln('<TR><TD><B><A HREF="g_traspaso.html?pa_id=1&'+baseHtml+'">Traspasos</A></B></TD></TR>');
writeln('<TR><TD><B><A HREF="o_unlockfra.html?pa_id=1&'+baseHtml+'">Desbloqueo </A></B></TD></TR>');
writeln('<TR><TD><B><A HREF="o_parame.html?pa_id=1&'+baseHtml+'">Parámetros</A></B></TD></TR>');
}
writeln('<TR><TD><B><A HREF="file:///P%7C/spool">Colas</A></B></TD></TR>');
writeln('</TABLE>');
</SERVER>
<P><FORM NAME="f_contents"><LEFT>
<HR></P>
<DL>
<P><B>Estructura P&aacute;gina:</B> </P>
</DL>
<P>
<SERVER>
if (request.FrameType == "L") {
writeln('<DL><INPUT TYPE="button" NAME="FullFrame" VALUE="Completa"');
writeln(' OnClick="Go_BaseFrame(\'F\',\''+request.ViewFkey+'\',\''+client.MsgScroll+'\',\''+client.username+'\')"></DL>');
writeln('<DL><INPUT TYPE="button" NAME="TopFrame" VALUE="Cabecera"');
writeln(' OnClick="Go_BaseFrame(\'T\',\''+request.ViewFkey+'\',\''+client.MsgScroll+'\',\''+client.username+'\')"></DL>');
}
if (request.FrameType == "T") {
writeln('<DL><INPUT TYPE="button" NAME="FullFrame" VALUE="Completa"');
writeln(' OnClick="Go_BaseFrame(\'F\',\''+request.ViewFkey+'\',\''+client.MsgScroll+'\',\''+client.username+'\')"></DL>');
writeln('<DL><INPUT TYPE="button" NAME="LeftFrame" VALUE="Lateral"');
writeln(' OnClick="Go_BaseFrame(\'L\',\''+request.ViewFkey+'\',\''+client.MsgScroll+'\',\''+client.username+'\')"></DL>');
}
if (request.FrameType == "F") {
writeln('<DL><INPUT TYPE="button" NAME="LeftFrame" VALUE="Lateral"');
writeln(' OnClick="Go_BaseFrame(\'L\',\''+request.ViewFkey+'\',\''+client.MsgScroll+'\',\''+client.username+'\')"></DL>');
writeln('<DL><INPUT TYPE="button" NAME="TopFrame" VALUE="Cabecera"');
writeln(' OnClick="Go_BaseFrame(\'T\',\''+request.ViewFkey+'\',\''+client.MsgScroll+'\',\''+client.username+'\')"></DL>');
}
else {
writeln('<hr>');
writeln('<DL><A HREF="fr_conten.html" target="contents" javascript: onClick="NetHelp(\'intro\')"><IMG SRC="images/bb_help.gif" ALT="Ayuda" BORDER=0 HEIGHT=61 WIDTH=61></A>');
writeln('<A HREF="logout.html" target="_top"><IMG SRC="images/bb_logout.gif" ALT="Logout" BORDER=0 HEIGHT=61 WIDTH=66></A></DL>');
}</SERVER>
<HR></FORM></P>
</BODY>
</HTML>

34
fr_main.html Normal file
View File

@ -0,0 +1,34 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Main Frame in FrameSet</TITLE>
<META NAME="FORMATTER" CONTENT="Microsoft FrontPage 1.1">
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (Win95; I) [Netscape]">
</HEAD>
<BODY BACKGROUND="images/backgrnd.gif">
<DT>&nbsp;</DT>
<CENTER><TABLE BORDER=4 >
<TR VALIGN=TOP>
<TD WIDTH="100%" HEIGHT="100%" BGCOLOR="#FFFFFF">
<DT><A HREF="http://ctasapagar.malaga.sando.es/Ctas_a_Pagar/home.html" target="_top"><IMG SRC="images/sand2new.gif" BORDER=0 HEIGHT=117 WIDTH=424></A></DT>
</TD>
</TR>
</TABLE></CENTER>
<H1 ALIGN=CENTER><FONT COLOR="#FF0080">Cuentas a Pagar</FONT></H1>
<!--
<A HREF="mailto:%20info%3Csando_malaga@admisys.com%3E"><IMG SRC="images/emailed.gif" HEIGHT=52 WIDTH=45 BORDER=0></A>
-->
<SERVER>
if (request.goback){
writeln('<IMG SRC="images/linea.gif" HEIGHT=20 WIDTH=500 ALIGN=BOTTOM>&nbsp;</P></CENTER>');
writeln('<A HREF="javascript:history.back()"><CENTER><H1>Volver </H1>');
writeln('<A HREF="javascript:history.back()"><IMG SRC="images/l_arrowg.gif" ALT="Volver" BORDER=0 HEIGHT=52 WIDTH=70>')
}
</SERVER>
<CENTER><DT ALIGN=CENTER>&nbsp;</DT></CENTER>
</BODY>
</HTML>

26
fr_maintop.html Normal file
View File

@ -0,0 +1,26 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE></TITLE>
<META NAME="Author" CONTENT="">
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (WinNT; I) [Netscape]">
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
</HEAD>
<BODY BACKGROUND="images/backgrnd.gif">
<FORM NAME="buttonbar">
<LEFT>
<SERVER>
//if (request.FrameType == "F") {
//}
</SERVER>
<P><CENTER><B><FONT COLOR="#3cb74e" SIZE=+2>Construcciones SANDO </FONT></B>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B><FONT
COLOR="#FF0080" SIZE=+2> Dpto. Cuentas a pagar</FONT></B></CENTER></P>
</FORM>
</BODY>
</HTML>

33
fr_top.html Normal file
View File

@ -0,0 +1,33 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE></TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (Win95; I) [Netscape]">
</HEAD>
<BODY BACKGROUND="images/backgrnd.gif">
<P><!--
<param name="bgImage" value="images/backgrnd.gif">
-->
<APPLET code="Banners.class" width="750" height="50">
<PARAM name="borderColor" value="black">
<PARAM name="bgImage" value="images/backgrnd.gif">
<PARAM name="textColor" value="1BC065">
<PARAM name="pause" value="1">
<PARAM name="exit" value="scrollLeft">
<PARAM name="shadowDepth" value="2">
<PARAM name="align" value="Top">
<PARAM name="fps" value="20">
<PARAM name="repeat" value="1">
<PARAM name="bgExit" value="None">
<PARAM name="messages" value="Construcciones Sánchez Domínguez S.A. |Departamento de Cuentas a Pagar {font=TimesRoman} {style=Bold} {repeat=2} {bgEnter=Squeeze} {bgExit=Squeeze} {textColor=FF0080} {emboss=true}">
<PARAM name="font" value="Helvetica">
<PARAM name="cpf" value="2">
<PARAM name="enter" value="scrollLeft">
<PARAM name="bgEnter" value="None">
<PARAM name="style" value="BoldItalic">
<PARAM name="size" value="36">
<PARAM name="shadowColor" value="darkGray">
</APPLET></P>
</BODY>
</HTML>

419
g_albaran.html Normal file
View File

@ -0,0 +1,419 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: g_albaran.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>albaranes</TITLE>
</HEAD>
<SERVER>
var HOY=new Date();
// Algunos formatos para fechas.
var NLDF="YY/M/D"; // para columnas en las queries INFORMIX
var baseHtml="";
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln(' <BODY');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
if (request.gofunc) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_albaran;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="o_albaran.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
writeln('</SCRIPT>');
}
if ( request.search1 || request.search2 || request.desde || request.hasta || request.f_orden) {
dbConnect();
if (!request.gofunc) {
if ( request.search1 || request.desde || request.hasta ) {
//Si se busca usando el texto de entrada
if (request.desde && request.hasta) {
var desde_fecha=DateFormat(request.desde,NLDF);
if ( desde_fecha.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
var hasta_fecha=DateFormat(request.hasta,NLDF);
if ( hasta_fecha.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
c_albaranes = database.cursor("SELECT * FROM albaranes,proveedores WHERE albaranes.nif=proveedores.nif and fecha_emision Between '" +
desde_fecha + "' and '"+ hasta_fecha + "' ORDER BY " + client.criteria);
}
} else if (request.search1) {
c_facturas = database.cursor("SELECT * FROM albaranes,proveedores WHERE albaranes.nif=proveedores.nif and "+ client.criteria +" MATCHES '" +
request.search1 + "' ORDER BY " + client.criteria);
} else if (request.f_orden) {
var criterio=""
if ( request.f_desde.length > 0 ) {
var f_desde=DateFormat(request.f_desde,NLDF);
if ( f_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
criterio=" fecha_emision >= '"+f_desde+"' "
}
if ( request.f_hasta.length > 0 ) {
var f_hasta=DateFormat(request.f_hasta,NLDF);
if ( f_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" fecha_emision <= '"+f_hasta+"' "
}
if ( request.cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" cod_centro matches '"+request.cod_centro+"'"
}
if ( request.nif.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" albaranes.nif matches '"+request.nif+"'"
}
if ( request.nro_reg.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" albaranes.nro_reg matches '"+StringClip(true,request.nro_reg)+"'"
}
if ( request.razon_social.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
var razon_social=request.razon_social;
// var lowcaps = request.razon_social.toLowerCase();
// var uppercaps = request.razon_social.toUpperCase();
criterio=criterio+"razon_social matches '"+razon_social+"'"
}
c_albaranes = database.cursor("SELECT * FROM albaranes,proveedores WHERE albaranes.nif=proveedores.nif and "+ criterio +
" ORDER BY " + request.f_orden);
}
if (!c_albaranes)
DbsError(false,-1);
client.search1 = request.search1;
}
if(request.search2) {
if(request.search2 == "all") {
//Selecciono todos los albaranes, sin criterio
c_albaranes = database.cursor("SELECT * FROM albaranes,proveedores where albaranes.nif=proveedores.nif ORDER BY nro_reg ");
if (!c_albaranes)
DbsError(false,-1);
}
else {
//Selecciona todas las filas en las que el descripcion empieza con la letra elejida.
var lowcaps = request.search2.toLowerCase();
if (client.criteria == "razon_social" )
c_albaranes = database.cursor("SELECT * FROM albaranes,proveedores "+
" WHERE albaranes.nif=proveedores.nif and proveedores." +
client.criteria + " MATCHES '" + request.search2 + "*' OR proveedores." +
client.criteria +" MATCHES '" + lowcaps + "*'"+
" ORDER BY " + client.criteria);
else
c_albaranes = database.cursor("SELECT * FROM albaranes,proveedores "+
" WHERE albaranes.nif=proveedores.nif and albaranes." +
client.criteria + " MATCHES '" + request.search2 + "*' OR albaranes." +
client.criteria +" MATCHES '" + lowcaps + "*'"+
" ORDER BY " + client.criteria);
if (!c_albaranes)
DbsError(false,-1);
client.search2 = request.search2;
}
}
}
else {
if (!request.nro_reg && !request.fecha_emision ) {
request.multiple ="Múltiple";
}
}
if (request.fecha_emision) {
client.criteria="fecha_emision";
client.des_criteria="cuya fecha de emisión";
}
if (request.multiple ) {
client.criteria="multiple";
client.des_criteria="según criterio de búsqueda ";
}
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RangoFecha(obj,clave) {');
writeln(' if (obj.value.length > 0 ){ ');
writeln(' if (clave == "emision") { ');
writeln(' if (dateCmp(obj.value,document.g_albaran.f_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_albaran.f_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "fecha") { ');
writeln(' if (dateCmp(obj.value,document.g_albaran.desde.value) != 1 ) {');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_albaran.desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' } ');
writeln('} ');
writeln('function HastaDefault(obj,clave) {');
writeln(' if (obj.value.length <= 0 ){ ');
writeln(' if (clave == "emision") ');
writeln(' obj.value=document.g_albaran.f_desde.value;');
writeln(' if (clave == "fecha") ');
writeln(' obj.value=document.g_albaran.desde.value;');
writeln(' } ');
writeln('} ');
writeln('</SCRIPT>');
criterio="criterio múltiple";
if ( client.criteria == "multiple")
criterio="criterio múltiple";
if ( client.criteria == "fecha_emision" )
criterio="por fecha emision";
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Albaranes",criterio,"ab_");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM NAME="g_albaran" METHOD="post" ACTION="o_albaran.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("Albaranes",criterio,"ab_")
writeln('</FORM>');
}
writeln('<FORM NAME="g_albaran" method="Post" action="g_albaran.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM NAME="g_albaran" method="Post" action="g_albaran.html?waux='+request.waux+"&"+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
writeln("<B>Cambiar Seleccion Datos por: </B>");
if ( client.criteria != "fecha_emision" )
writeln("<INPUT TYPE='submit' NAME='fecha_emision' value='F.Emisión'>");
if ( client.criteria != "multiple" )
writeln("<INPUT TYPE='submit' NAME='multiple' value='Múltiple'>");
writeln("<HR>");
if (client.criteria == "fecha_emision" || client.criteria == "multiple" ) {
if (client.criteria == "multiple" ) {
if (!request.nif)
request.nif="";
if (!request.cod_centro)
request.cod_centro="";
if (!request.razon_social)
request.razon_social="";
if (!request.f_desde)
request.f_desde="";
if (!request.f_hasta)
request.f_hasta="";
if (!request.nro_reg)
request.nro_reg="";
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('<TABLE ALIGN="CENTER" BORDER=0>')
writeln('<TR><TD ALIGN=LEFT><B>Nro.Reg.: </B></TD><TD><INPUT TYPE="text" NAME="nro_reg" VALUE="'+request.nro_reg+'" SIZE=10 >');
writeln('<INPUT TYPE="submit" value=" - "></TD>');
writeln("<TR><TD ALIGN=LEFT>N.I.F. .......: </TD><TD><INPUT type='text' name='nif' size=12 maxlength=12 VALUE='"+request.nif +"' onChange='this.value=this.value.toUpperCase()' > </TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Razón Social .: </TD><TD><INPUT type='text' name='razon_social' size=30 maxlength=40 VALUE='"+request.razon_social +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Código Centro : </TD><TD><INPUT type='text' name='cod_centro' size=12 maxlength=12 VALUE='"+request.cod_centro +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Emitido Desde: </TD><TD><INPUT type='text' name='f_desde' size=8 maxlength=10 VALUE='"+request.f_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='f_hasta' size=8 maxlength=10 VALUE='"+request.f_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"emision\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"emision\")' ></TD></TR>");
writeln('<TR><TD ALIGN=LEFT>Ordenado por: </TD><TD><SELECT NAME="f_orden" SIZE=1>');
writeln('<OPTION VALUE="razon_social" >Razón Social');
writeln('<OPTION VALUE="nif" >N.I.F.');
writeln('<OPTION VALUE="nro_reg" SELECTED>Nro.Reg. ');
writeln('<OPTION VALUE="fecha_emision" >Fecha Emisión');
writeln('<OPTION VALUE="cod_centro" >Centro ');
writeln('</SELECT></TD></TR></SELECT></TABLE>');
}
else {
if (!request.desde)
request.desde="";
if (!request.hasta)
request.hasta="";
writeln("Desde: <INPUT type='text' name='desde' size=8 maxlength=10 VALUE='"+request.desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='hasta' size=8 maxlength=10 VALUE='"+request.hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"fecha\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"fecha\")' >");
}
}
else {
if(request.search1 == null)
writeln("<INPUT type='text' name='search1'>");
else
writeln("<INPUT type='text' name='search1' VALUE='" + request.search1 + "'>");
}
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('</FORM>');
if ( client.criteria == "multiple" )
writeln("<b>Según criterio </b>");
if ( client.criteria == "fecha_emision" )
writeln("<b>Fecha de Emisión entre:</b>");
if ( client.criteria == "nro_reg" )
writeln("Número de Registro empieza por:<BR>")
writeln("<CENTER>");
if (!request.waux) {
refHtml="g_albaran.html?"+baseHtml+"&search2=";
}
else {
refHtml="g_albaran.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
if ( client.criteria != "fecha_emision" && client.criteria != "multiple" )
buttonsLetrasNros(refHtml,false);
writeln("</CENTER><HR>");
if (request.search1) {
if ( client.criteria == "fecha_emision" )
writeln("albaranes "+ client.des_criteria +" entre <FONT SIZE=+2>" + request.desde + " - "+ request.hasta +" </FONT><BR>")
else
writeln("albaranes "+ client.des_criteria +" contiene <FONT SIZE=+2>" + request.search1 + "</FONT><BR>")
}
writeln("<HR>");
if(request.search1 || request.search2 || request.desde || request.hasta || request.f_orden ) {
writeln('<TABLE ALIGN="CENTER" BORDER=1>');
var nrows=0;
while (c_albaranes.next()) {
nrows++;
LastRow=c_albaranes.nro_reg;
//lista de todos los albaranes devueltos por el cursor.
if ( client.criteria == "cod_centro" ) {
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_albaran.html"+
"?ab_nro_reg=" +escape(StringClip(false,c_albaranes.nro_reg)) +"&"+baseHtml+"'>" +
c_albaranes.cod_centro + "</TD><TD>" +
c_albaranes.nro_reg + "</TD><TD>" +
datetoString(c_albaranes.fecha_emision) + "</TD><TD>" +
c_albaranes.nif + "</TD><TD>" +
c_albaranes.razon_social +
"</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_albaran.html?waux="+request.waux+
"&ab_nro_reg="+ escape(StringClip(false,c_albaranes.nro_reg)) +"&"+baseHtml+ "'>" +
c_albaranes.cod_centro + "</TD><TD>" +
c_albaranes.descripcion + "</TD><TD>" +
c_albaranes.nro_reg + "</TD><TD>" +
datetoString(c_albaranes.fecha_emision) + "</TD><TD>" +
c_albaranes.nif + "</TD><TD>" +
c_albaranes.razon_social +
"</A><BR></TD></TR>");
}
if ( client.criteria == "fecha_emision" ){
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_albaran.html"+
"?ab_nro_reg=" + escape(StringClip(false,c_albaranes.nro_reg)) + "&"+baseHtml+"'>" +
datetoString(c_albaranes.fecha_emision) + "</TD><TD>" +
c_albaranes.nro_reg + "</TD><TD>" +
c_albaranes.nif + "</TD><TD>" +
c_albaranes.razon_social + "</TD><TD>" +
c_albaranes.cod_centro +
"</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_albaran.html?waux="+request.waux+
"&ab_nro_reg="+ escape(StringClip(false,c_albaranes.nro_reg)) +"&"+baseHtml+ "'>" +
datetoString(c_albaranes.fecha_emision) + "</TD><TD>" +
c_albaranes.nro_reg + "</TD><TD>" +
c_albaranes.nif + "</TD><TD>" +
c_albaranes.razon_social + "</TD><TD>" +
c_albaranes.cod_centro +
"</A><BR></TD></TR>");
}
if ( client.criteria == "nro_reg" || client.criteria == "multiple" ){
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_albaran.html"+
"?ab_nro_reg=" + escape(StringClip(false,c_albaranes.nro_reg)) +"&"+baseHtml+"'>" +
c_albaranes.nro_reg + "</TD><TD>" +
datetoString(c_albaranes.fecha_emision) + "</TD><TD>" +
c_albaranes.nif + "</TD><TD>" +
c_albaranes.razon_social + "</TD><TD>" +
c_albaranes.cod_centro + "</TD><TD>" +
"</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_albaran.html?waux="+request.waux+
"&ab_nro_reg="+ escape(StringClip(false,c_albaranes.nro_reg)) +"&"+baseHtml+ "'>" +
c_albaranes.nro_reg + "</TD><TD>" +
datetoString(c_albaranes.fecha_emision) + "</TD><TD>" +
c_albaranes.nif + "</TD><TD>" +
c_albaranes.razon_social + "</TD><TD>" +
c_albaranes.cod_centro +
"</A><BR></TD></TR>");
}
if ( client.criteria == "nif") {
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_albaran.html"+
"?ab_nro_reg=" + escape(StringClip(false,c_albaranes.nro_reg)) +"&"+baseHtml+ "'>" +
c_albaranes.nif + "</TD><TD>" +
c_albaranes.razon_social + "</TD><TD>" +
c_albaranes.nro_reg + "</TD><TD>" +
datetoString(c_albaranes.fecha_emision) + "</TD><TD>" +
c_albaranes.cod_centro +
"</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_albaran.html?waux="+request.waux+
"&ab_nro_reg="+ escape(StringClip(false,c_albaranes.nro_reg)) +"&"+baseHtml+ "'>" +
c_albaranes.nif + "</TD><TD>" +
c_albaranes.razon_social + "</TD><TD>" +
c_albaranes.nro_reg + "</TD><TD>" +
datetoString(c_albaranes.fecha_emision) + "</TD><TD>" +
c_albaranes.cod_centro +
"</A><BR></TD></TR>");
}
if ( client.criteria == "razon_social") {
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_albaran.html"+
"?ab_nro_reg=" + escape(StringClip(false,c_albaranes.nro_reg)) +"&"+baseHtml+ "'>" +
c_albaranes.razon_social + "</TD><TD>" +
c_albaranes.nif + "</TD><TD>" +
c_albaranes.nro_reg + "</TD><TD>" +
datetoString(c_albaranes.fecha_emision) + "</TD><TD>" +
c_albaranes.cod_centro +
"</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_albaran.html?waux="+request.waux+
"&ab_nro_reg="+ escape(StringClip(false,c_albaranes.nro_reg)) +"&"+baseHtml+ "'>" +
c_albaranes.razon_social + "</TD><TD>" +
c_albaranes.nif + "</TD><TD>" +
c_albaranes.nro_reg + "</TD><TD>" +
datetoString(c_albaranes.fecha_emision) + "</TD><TD>" +
c_albaranes.cod_centro +
"</A><BR></TD></TR>");
}
}
c_albaranes.close();
writeln("</TABLE>");
if ( nrows == 1 )
redirect("o_albaran.html?ab_nro_reg=" + escape(StringClip(false,LastRow))+"&"+baseHtml)
}
if (!request.waux)
writeSignature(true);
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

214
g_banco.html Normal file
View File

@ -0,0 +1,214 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: g_banco.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>bancos</TITLE>
</HEAD>
<SERVER>
var baseHtml="";
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln(' <BODY');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
if (request.gofunc) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_banco;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="o_banco.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
writeln('</SCRIPT>');
}
if(request.search1 || request.search2) {
dbConnect();
if(request.search1 && !request.gofunc) {
//Si se busca usando el texto de entrada
c_bancos = database.cursor("SELECT * FROM bancos WHERE "+ client.criteria +" MATCHES '" + request.search1 + "' ORDER BY " + client.criteria);
if (!c_bancos)
DbsError(false,-1);
client.search1 = request.search1;
}
if(request.search2 && !request.gofunc) {
if(request.search2 == "all") {
//Selecciono todos los bancos, sin criterio
c_bancos = database.cursor("SELECT * FROM bancos ORDER BY nombre ");
if (!c_bancos)
DbsError(false,-1);
}
else {
//Selecciona todas las filas en las que el nombre empieza con la letra elejida.
var lowcaps = request.search2.toLowerCase();
c_bancos = database.cursor("SELECT * FROM bancos WHERE "+ client.criteria + " MATCHES '" + request.search2 + "*' OR " + client.criteria +" MATCHES '" + lowcaps + "*' ORDER BY " + client.criteria);
if (!c_bancos)
DbsError(false,-1);
}
client.search2 = request.search2;
}
}
else {
if (!request.cod_banco && !request.nombre ) {
request.nombre ="nombre ";
}
}
if (request.cod_banco) {
client.criteria="cod_banco";
client.des_criteria="cuyo código";
}
if (request.nombre ) {
client.criteria="nombre ";
client.des_criteria="cuya nombre";
}
if ( client.criteria == "nombre " ) {
criterio=" por Nombre ";
}
if ( client.criteria == "cod_banco" ) {
criterio=" por Código ";
}
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Bancos",criterio,"ba_");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="o_banco.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("Bancos",criterio,"ba_")
writeln('</FORM>');
}
writeln('<FORM method="Post" NAME="g_banco" action="g_banco.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM method="Post" NAME="g_banco" action="g_banco.html?waux='+request.waux+'&'+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
if ( client.criteria == "nombre " ) {
writeln("<B>Cambiar Seleccion Datos por: </B>");
writeln("<INPUT TYPE='submit' NAME='cod_banco' value='Código'>");
writeln("<HR>");
writeln("<b>Nombre contiene:</b>");
}
if ( client.criteria == "cod_banco" ) {
writeln("<B> Buscar por: </B>");
writeln("<INPUT TYPE='submit' NAME='nombre ' value='Nombre'>");
writeln("<HR>");
writeln("<b>Código contiene:</b>");
}
if(request.search1 == null) {
writeln("<INPUT type='text' name='search1'>");
}
else {
writeln("<INPUT type='text' name='search1' VALUE='" + request.search1 + "'>");
}
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('</FORM>');
if (!client.criteria) {
client.criteria="nombre ";
client.des_criteria="cuya razón social";
}
if ( client.criteria == "nombre " ) {
client.des_criteria="cuya nombre";
writeln("Nombre empieza por:</BR>")
}
if ( client.criteria == "cod_banco" ) {
client.des_criteria="cuyo Código";
writeln("Código empieza por:<BR>")
}
writeln("<CENTER>");
if (!request.waux) {
refHtml="g_banco.html?"+baseHtml+"&search2=";
}
else {
refHtml="g_banco.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
buttonsLetrasNros(refHtml,true);
writeln("</CENTER><HR>");
if (request.search1) {
writeln("bancos "+ client.des_criteria +" contiene <FONT SIZE=+2>" + request.search1 + "</FONT><BR>")
}
if (request.search2) {
if(request.search2 == "all") {
writeln("Lista de todos los bancos<BR>");
}
else {
writeln("bancos " + client.des_criteria + " empieza por <FONT SIZE=+2>" + request.search2 + "</FONT><BR>");
}
}
writeln("<HR>");
if (request.search1 || request.search2) {
if ( client.criteria == "cod_banco" )
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
var nrows=0;
while (c_bancos.next()) {
nrows++;
LastRow=c_bancos.cod_banco;
//lista de todos los bancos devueltos por el cursor.
if ( client.criteria == "nombre " ) {
if (!request.waux)
writeln("<IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_banco.html?ba_cod_banco=" + escape(StringClip(false,c_bancos.cod_banco))+"&"+baseHtml+"'>" + c_bancos.nombre + "</A><BR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_banco.html?waux="+request.waux+"&ba_cod_banco="+escape(StringClip(false,c_bancos.cod_banco))+"&"+baseHtml + "'>" + c_bancos.cod_banco + "</TD><TD>"+ c_bancos.nombre + "</A><BR></TD></TR>");
}
if ( client.criteria == "cod_banco" ) {
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_banco.html?ba_cod_banco=" +escape(StringClip(false,c_bancos.cod_banco))+"&"+baseHtml + "'>" + c_bancos.cod_banco + "</TD><TD>" +c_bancos.nombre + "</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_banco.html?waux="+request.waux+"&ba_cod_banco="+escape(StringClip(false,c_bancos.cod_banco))+"&"+baseHtml + "'>" + c_bancos.cod_banco + "</TD><TD>"+ c_bancos.nombre + "</A><BR></TD></TR>");
}
}
c_bancos.close();
if ( client.criteria == "cod_banco" )
writeln("</TABLE>");
if ( nrows == 1 )
redirect("o_banco.html?ba_cod_banco=" + escape(StringClip(false,LastRow))+"&"+baseHtml)
}
if (!request.waux) {
writeSignature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

210
g_centro.html Normal file
View File

@ -0,0 +1,210 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: g_centro.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>centros</TITLE>
</HEAD>
<SERVER>
var baseHtml="";
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln(' <BODY');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
if (request.gofunc) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_centro;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="o_centro.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
writeln('</SCRIPT>');
}
if(request.search1 || request.search2) {
dbConnect();
if(request.search1 && !request.gofunc) {
//Si se busca usando el texto de entrada
c_centros = database.cursor("SELECT * FROM centros WHERE "+ client.criteria +" MATCHES '" + request.search1 + "' ORDER BY " + client.criteria);
if (!c_centros)
DbsError(false,-1);
client.search1 = request.search1;
}
if(request.search2 && !request.gofunc) {
if(request.search2 == "all") {
//Selecciono todos los centros, sin criterio
c_centros = database.cursor("SELECT * FROM centros ORDER BY descripcion ");
if (!c_centros)
DbsError(false,-1);
}
else {
//Selecciona todas las filas en las que el descripcion empieza con la letra elejida.
var lowcaps = request.search2.toLowerCase();
c_centros = database.cursor("SELECT * FROM centros WHERE "+ client.criteria + " MATCHES '" + request.search2 + "*' OR " + client.criteria +" MATCHES '" + lowcaps + "*' ORDER BY " + client.criteria);
if (!c_centros)
DbsError(false,-1);
}
client.search2 = request.search2;
}
}
else {
if (!request.cod_centro && !request.descripcion ) {
request.descripcion ="descripcion";
}
}
if (request.cod_centro) {
client.criteria="cod_centro";
client.des_criteria="cuyo código";
}
if (request.descripcion ) {
client.criteria="descripcion ";
client.des_criteria="cuya descripción";
}
if ( client.criteria == "descripcion " ) {
criterio=" por descripción ";
}
if ( client.criteria == "cod_centro" ) {
criterio=" por Código ";
}
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Centros",criterio,"ce_");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="o_centro.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("Centros",criterio,"ce_")
writeln('</FORM>');
}
writeln('<FORM method="Post" NAME="g_centro" action="g_centro.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM method="Post" NAME="g_centro" action="g_centro.html?waux='+request.waux+"&"+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
if ( client.criteria == "descripcion " ) {
writeln("<B>Cambiar Seleccion Datos por: </B>");
writeln("<INPUT TYPE='submit' NAME='cod_centro' value='Código'>");
writeln("<HR>");
writeln("<b>descripción contiene:</b>");
}
if ( client.criteria == "cod_centro" ) {
writeln("<B> Buscar por: </B>");
writeln("<INPUT TYPE='submit' NAME='descripcion' value='Descripción'>");
writeln("<HR>");
writeln("<b>Código contiene:</b>");
}
if(request.search1 == null) {
writeln("<INPUT type='text' name='search1'>");
}
else {
writeln("<INPUT type='text' name='search1' VALUE='" + request.search1 + "'>");
}
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('</FORM>');
if (!client.criteria) {
client.criteria="descripcion ";
client.des_criteria="cuya descripción";
}
if ( client.criteria == "descripcion " ) {
client.des_criteria="cuya descripción";
writeln("descripcion empieza por:</BR>")
}
if ( client.criteria == "cod_centro" ) {
client.des_criteria="cuyo Código";
writeln("Código empieza por:<BR>")
}
writeln("<CENTER>");
if (!request.waux) {
refHtml="g_centro.html?"+baseHtml+"&search2=";
}
else {
refHtml="g_centro.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
buttonsLetrasNros(refHtml,true);
writeln("</CENTER><HR>");
if (request.search1) {
writeln("centros "+ client.des_criteria +" contiene <FONT SIZE=+2>" + request.search1 + "</FONT><BR>")
}
if (request.search2) {
if(request.search2 == "all") {
writeln("Lista de todos los centros<BR>");
}
else {
writeln("centros " + client.des_criteria + " empieza por <FONT SIZE=+2>" + request.search2 + "</FONT><BR>");
}
}
writeln("<HR>");
if (request.search1 || request.search2) {
if ( client.criteria == "cod_centro" )
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
while (c_centros.next()) {
//lista de todos los centros devueltos por el cursor.
if ( client.criteria == "descripcion " ) {
if (!request.waux)
writeln("<IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_centro.html?ce_cod_centro=" + escape(StringClip(false,c_centros.cod_centro)) +"&"+baseHtml+ "'>" + c_centros.descripcion + "</A><BR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_centro.html?waux="+request.waux+"&ce_cod_centro="+ escape(StringClip(false,c_centros.cod_centro))+"&"+baseHtml + "'>" + c_centros.cod_centro + "</TD><TD>"+ c_centros.descripcion + "</A><BR></TD></TR>");
}
if ( client.criteria == "cod_centro" ) {
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_centro.html?ce_cod_centro=" + escape(StringClip(false,c_centros.cod_centro)) +"&"+baseHtml+ "'>" + c_centros.cod_centro + "</TD><TD>" +c_centros.descripcion + "</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_centro.html?waux="+request.waux+"&ce_cod_centro="+ escape(StringClip(false,c_centros.cod_centro))+"&"+baseHtml + "'>" + c_centros.cod_centro + "</TD><TD>"+ c_centros.descripcion + "</A><BR></TD></TR>");
}
}
c_centros.close();
if ( client.criteria == "cod_centro" )
writeln("</TABLE>");
}
if (!request.waux) {
writeSignature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

208
g_clave.html Normal file
View File

@ -0,0 +1,208 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: g_clave.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>claves</TITLE>
</HEAD>
<SERVER>
var baseHtml="";
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln(' <BODY');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
if (request.gofunc) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_clave;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="o_clave.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
writeln('</SCRIPT>');
}
if(request.search1 || request.search2) {
dbConnect();
if(request.search1 && !request.gofunc) {
//Si se busca usando el texto de entrada
c_claves = database.cursor("SELECT * FROM claves WHERE "+ client.criteria +" MATCHES '" + request.search1 + "' ORDER BY " + client.criteria);
if (!c_claves)
DbsError(false,-1);
client.search1 = request.search1;
}
if(request.search2 && !request.gofunc) {
if(request.search2 == "all") {
//Selecciono todos los claves, sin criterio
c_claves = database.cursor("SELECT * FROM claves ORDER BY "+client.criteria+" ");
if (!c_claves)
DbsError(false,-1);
}
else {
//Selecciona todas las filas en las que el descripcion empieza con la letra elejida.
var lowcaps = request.search2.toLowerCase();
c_claves = database.cursor("SELECT * FROM claves WHERE "+ client.criteria + " MATCHES '" + request.search2 + "*' OR " + client.criteria +" MATCHES '" + lowcaps + "*' ORDER BY " + client.criteria);
if (!c_claves)
DbsError(false,-1);
}
client.search2 = request.search2;
}
}
else {
if (!request.cod_clave && !request.descripcion ) {
request.descripcion ="descripcion ";
}
}
if (request.cod_clave) {
client.criteria="cod_clave";
client.des_criteria="cuyo código";
}
if (request.descripcion ) {
client.criteria="descripcion ";
client.des_criteria="cuya descripción";
}
if ( client.criteria == "descripcion " )
criterio=" por descripcion ";
if ( client.criteria == "cod_clave" )
criterio=" por Código ";
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Claves",criterio,"cv_");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="o_clave.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("Claves",criterio,"cv_");
writeln('</FORM>');
}
writeln('<FORM method="Post" NAME="g_clave" action="g_clave.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM method="Post" NAME="g_clave" action="g_clave.html?waux='+request.waux+'&'+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
if ( client.criteria == "descripcion " ) {
writeln("<B>Cambiar Seleccion Datos por: </B>");
writeln("<INPUT TYPE='submit' NAME='cod_clave' value='Código'>");
writeln("<HR>");
writeln("<b>Descripción contiene:</b>");
}
if ( client.criteria == "cod_clave" ) {
writeln("<B> Buscar por: </B>");
writeln("<INPUT TYPE='submit' NAME='descripcion ' value='Descripción'>");
writeln("<HR>");
writeln("<b>Código contiene:</b>");
}
if(request.search1 == null) {
writeln("<INPUT type='text' name='search1'>");
}
else {
writeln("<INPUT type='text' name='search1' VALUE='" + request.search1 + "'>");
}
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('</FORM>');
if (!client.criteria) {
client.criteria="descripcion ";
client.des_criteria="cuya descripción";
}
if ( client.criteria == "descripcion " ) {
client.des_criteria="cuya descripción";
writeln("Descripcion empieza por:</BR>")
}
if ( client.criteria == "cod_clave" ) {
client.des_criteria="cuyo Código";
writeln("Código empieza por:<BR>")
}
writeln("<CENTER>");
if (!request.waux) {
refHtml="g_clave.html?"+baseHtml+"&search2=";
}
else {
refHtml="g_clave.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
buttonsLetrasNros(refHtml,true);
writeln("</CENTER><HR>");
if (request.search1) {
writeln("claves "+ client.des_criteria +" contiene <FONT SIZE=+2>" + request.search1 + "</FONT><BR>")
}
if (request.search2) {
if(request.search2 == "all") {
writeln("Lista de todos los claves<BR>");
}
else {
writeln("claves " + client.des_criteria + " empieza por <FONT SIZE=+2>" + request.search2 + "</FONT><BR>");
}
}
writeln("<HR>");
if (request.search1 || request.search2) {
if ( client.criteria == "cod_clave" )
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
while (c_claves.next()) {
//lista de todos los claves devueltos por el cursor.
if ( client.criteria == "descripcion " ) {
if (!request.waux)
writeln("<IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_clave.html?cv_cod_clave=" + escape(StringClip(false,c_claves.cod_clave))+"&"+baseHtml + "'>" + c_claves.descripcion + "</A><BR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_clave.html?waux="+request.waux+"&cv_cod_clave="+ escape(StringClip(false,c_claves.cod_clave))+"&"+baseHtml + "'>" + c_claves.cod_clave + "</TD><TD>"+ c_claves.descripcion + "</A><BR></TD></TR>");
}
if ( client.criteria == "cod_clave" ) {
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_clave.html?cv_cod_clave=" + escape(StringClip(false,c_claves.cod_clave))+"&"+baseHtml + "'>" + c_claves.cod_clave + "</TD><TD>" +c_claves.descripcion + "</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_clave.html?waux="+request.waux+"&cv_cod_clave="+ escape(StringClip(false,c_claves.cod_clave))+"&"+baseHtml + "'>" + c_claves.cod_clave + "</TD><TD>"+ c_claves.descripcion + "</A><BR></TD></TR>");
}
}
c_claves.close();
if ( client.criteria == "cod_clave" )
writeln("</TABLE>");
}
if (!request.waux) {
writeSisgnature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

211
g_condpago.html Normal file
View File

@ -0,0 +1,211 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: g_condpago.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>Condiciones de Pago</TITLE>
</HEAD>
<SERVER>
var baseHtml="";
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln(' <BODY');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
writeln('</SCRIPT>');
if (request.gofunc) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_condpago;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="o_condpago.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
writeln('</SCRIPT>');
}
if(request.search1 || request.search2) {
dbConnect();
if(request.search1 && !request.gofunc) {
//Si se busca usando el texto de entrada
c_cond_pago = database.cursor("SELECT * FROM cond_pago WHERE "+ client.criteria +" MATCHES '" + request.search1 + "' ORDER BY " + client.criteria);
if (!c_cond_pago)
DbsError(false,-1);
client.search1 = request.search1;
}
if(request.search2 && !request.gofunc) {
if(request.search2 == "all") {
//Selecciono todos los cond_pago, sin criterio
c_cond_pago = database.cursor("SELECT * FROM cond_pago ORDER BY descripcion");
if (!c_cond_pago)
DbsError(false,-1);
}
else {
//Selecciona todas las filas en las que el nombre empieza con la letra elejida.
var lowcaps = request.search2.toLowerCase();
c_cond_pago = database.cursor("SELECT * FROM cond_pago WHERE "+ client.criteria + " MATCHES '" + request.search2 + "*' OR " + client.criteria +" MATCHES '" + lowcaps + "*' ORDER BY " + client.criteria);
if (!c_cond_pago)
DbsError(false,-1);
}
client.search2 = request.search2;
}
}
else {
if (!request.cond_pago && !request.descripcion) {
request.descripcion="descripcion";
}
}
if (request.cond_pago) {
client.criteria="cond_pago";
client.des_criteria="cuya N.I.F.";
}
if (request.descripcion) {
client.criteria="descripcion";
client.des_criteria="cuya razón social";
}
if ( client.criteria == "descripcion" ) {
criterio=" por Descripción ";
}
if ( client.criteria == "cond_pago" ) {
criterio=" por Código ";
}
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Condiciones Pago",criterio,"cp_");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM method="Post" action="o_condpago.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("Condiciones Pago",criterio,"cp_")
writeln('</FORM>');
}
writeln('<FORM method="Post" NAME="g_condpago" action="g_condpago.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM method="Post" action="g_condpago.html?waux='+request.waux+'&'+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
if ( client.criteria == "descripcion" ) {
writeln("<B>Cambiar Seleccion Datos por: </B>");
writeln("<INPUT TYPE='submit' NAME='cond_pago' value='Código'>");
writeln("<HR>");
writeln("<b>Descripción contiene:</b>");
}
if ( client.criteria == "cond_pago" ) {
writeln("<B> Buscar por: </B>");
writeln("<INPUT TYPE='submit' NAME='descripcion' value='Descripción'>");
writeln("<HR>");
writeln("<b>Código contiene:</b>");
}
if(request.search1 == null) {
writeln("<INPUT type='text' name='search1'>");
}
else {
writeln("<INPUT type='text' name='search1' VALUE='" + request.search1 + "'>");
} BaseHtml="g_cond_pago.html?search2=";
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('</FORM>');
if (!client.criteria) {
client.criteria="descripcion";
client.des_criteria="cuya descripción";
}
if ( client.criteria == "descripcion" ) {
client.des_criteria="cuya descripción";
writeln("Descripción empieza por:</BR>")
}
if ( client.criteria == "cond_pago" ) {
client.des_criteria="cuyo Código";
writeln("Código empieza por:<BR>")
}
writeln("<CENTER>");
if (!request.waux) {
refHtml="g_condpago.html?"+baseHtml+"&search2=";
}
else {
refHtml="g_condpago.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
buttonsLetrasNros(refHtml,true);
writeln("</CENTER><HR>");
if (request.search1) {
writeln("cond_pago "+ client.des_criteria +" contiene <FONT SIZE=+2>" + request.search1 + "</FONT><BR>")
}
if (request.search2) {
if(request.search2 == "all") {
writeln("Lista de todos las Condiciones de Pago<BR>");
}
else {
writeln("Condiciones de Pago " + client.des_criteria + " empieza por <FONT SIZE=+2>" + request.search2 + "</FONT><BR>");
}
}
writeln("<HR>");
if (request.search1 || request.search2) {
if ( client.criteria == "cond_pago" )
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
while (c_cond_pago.next()) {
//lista de todos los cond_pago devueltos por el cursor.
if ( client.criteria == "descripcion" ) {
if (!request.waux)
writeln("<IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_condpago.html?cp_cond_pago=" + escape(StringClip(false,c_cond_pago.cond_pago))+"&"+baseHtml + "'>" + c_cond_pago.descripcion + "</A><BR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_condpago.html?waux="+request.waux+"&cp_cond_pago="+escape(StringClip(false,c_cond_pago.cond_pago))+"&"+baseHtml + "'>" + c_cond_pago.cond_pago + "</TD><TD>"+ c_cond_pago.descripcion + "</A><BR></TD></TR>");
}
if ( client.criteria == "cond_pago" ) {
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_condpago.html?cp_cond_pago=" + escape(StringClip(false,c_cond_pago.cond_pago))+"&"+baseHtml + "'>" + c_cond_pago.cond_pago + "</TD><TD>" +c_cond_pago.descripcion + "</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_condpago.html?waux="+request.waux+"&cp_cond_pago="+escape(StringClip(false,c_cond_pago.cond_pago))+"&"+baseHtml + "'>" + c_cond_pago.cond_pago + "</TD><TD>"+ c_cond_pago.descripcion + "</A><BR></TD></TR>");
}
}
c_cond_pago.close();
if ( client.criteria == "cond_pago" )
writeln("</TABLE>");
}
if (!request.waux) {
writeSignature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

210
g_ctascont.html Normal file
View File

@ -0,0 +1,210 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: g_ctascont.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>ctasconts</TITLE>
</HEAD>
<SERVER>
var baseHtml="";
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln(' <BODY');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
if (request.gofunc) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_ctascont;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="o_ctascont.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
writeln('</SCRIPT>');
}
if(request.search1 || request.search2) {
dbConnect();
if(request.search1 && !request.gofunc) {
//Si se busca usando el texto de entrada
c_ctasconts = database.cursor("SELECT * FROM ctas_contables WHERE "+ client.criteria +" MATCHES '" + request.search1 + "' ORDER BY " + client.criteria);
if (!c_ctasconts)
DbsError(false,-1);
client.search1 = request.search1;
}
if(request.search2 && !request.gofunc) {
if(request.search2 == "all") {
//Selecciono todos los ctasconts, sin criterio
c_ctasconts = database.cursor("SELECT * FROM ctas_contables ORDER BY "+client.criteria+" ");
if (!c_ctasconts)
DbsError(false,-1);
}
else {
//Selecciona todas las filas en las que el descripcion empieza con la letra elejida.
var lowcaps = request.search2.toLowerCase();
c_ctasconts = database.cursor("SELECT * FROM ctas_contables WHERE "+ client.criteria + " MATCHES '" + request.search2 + "*' OR " + client.criteria +" MATCHES '" + lowcaps + "*' ORDER BY " + client.criteria);
if (!c_ctasconts)
DbsError(false,-1);
}
client.search2 = request.search2;
}
}
else {
if (!request.cta_contable && !request.descripcion ) {
request.descripcion ="descripcion ";
}
}
if (request.cta_contable) {
client.criteria="cta_contable";
client.des_criteria="cuyo código";
}
if (request.descripcion ) {
client.criteria="descripcion ";
client.des_criteria="cuya descripción";
}
if ( client.criteria == "descripcion " ) {
criterio=" por descripcion ";
}
if ( client.criteria == "cta_contable" ) {
criterio=" por Código ";
}
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Cuentas Contables",criterio,"ct_");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM method="Post" action="o_ctascont.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("Cuentas Contables",criterio,"ct_");
writeln('</FORM>');
}
writeln('<FORM method="Post" NAME="g_ctascont" action="g_ctascont.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM method="Post" NAME="g_ctascont" action="g_ctascont.html?waux='+request.waux+'&'+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
if ( client.criteria == "descripcion " ) {
writeln("<B>Cambiar Seleccion Datos por: </B>");
writeln("<INPUT TYPE='submit' NAME='cta_contable' value='Código'>");
writeln("<HR>");
writeln("<b>Descripción contiene:</b>");
}
if ( client.criteria == "cta_contable" ) {
writeln("<B> Buscar por: </B>");
writeln("<INPUT TYPE='submit' NAME='descripcion ' value='Descripción'>");
writeln("<HR>");
writeln("<b>Código contiene:</b>");
}
if(request.search1 == null) {
writeln("<INPUT type='text' name='search1'>");
}
else {
writeln("<INPUT type='text' name='search1' VALUE='" + request.search1 + "'>");
}
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('</FORM>');
if (!client.criteria) {
client.criteria="descripcion ";
client.des_criteria="cuya descripción";
}
if ( client.criteria == "descripcion " ) {
client.des_criteria="cuya descripción";
writeln("Descripcion empieza por:</BR>")
}
if ( client.criteria == "cta_contable" ) {
client.des_criteria="cuyo Código";
writeln("Código empieza por:<BR>")
}
writeln("<CENTER>");
if (!request.waux) {
refHtml="g_ctascont.html?"+baseHtml+"&search2=";
}
else {
refHtml="g_ctascont.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
buttonsLetrasNros(refHtml,true);
writeln("</CENTER><HR>");
if (request.search1) {
writeln("ctasconts "+ client.des_criteria +" contiene <FONT SIZE=+2>" + request.search1 + "</FONT><BR>")
}
if (request.search2) {
if(request.search2 == "all") {
writeln("Lista de todos los ctasconts<BR>");
}
else {
writeln("ctasconts " + client.des_criteria + " empieza por <FONT SIZE=+2>" + request.search2 + "</FONT><BR>");
}
}
writeln("<HR>");
if (request.search1 || request.search2) {
if ( client.criteria == "cta_contable" )
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
while (c_ctasconts.next()) {
//lista de todos los ctasconts devueltos por el cursor.
if ( client.criteria == "descripcion " ) {
if (!request.waux)
writeln("<IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_ctascont.html?ct_cta_contable=" +escape(StringClip(false,c_ctasconts.cta_contable))+"&"+baseHtml + "'>" + c_ctasconts.descripcion + "</A><BR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_ctascont.html?waux="+request.waux+"&ct_cta_contable="+escape(StringClip(false,c_ctasconts.cta_contable))+"&"+baseHtml + "'>" + c_ctasconts.cta_contable + "</TD><TD>"+ c_ctasconts.descripcion + "</A><BR></TD></TR>");
}
if ( client.criteria == "cta_contable" ) {
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_ctascont.html?ct_cta_contable=" +escape(StringClip(false,c_ctasconts.cta_contable))+"&"+baseHtml + "'>" + c_ctasconts.cta_contable + "</TD><TD>" +c_ctasconts.descripcion + "</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_ctascont.html?waux="+request.waux+"&ct_cta_contable="+escape(StringClip(false,c_ctasconts.cta_contable))+"&"+baseHtml + "'>" + c_ctasconts.cta_contable + "</TD><TD>"+ c_ctasconts.descripcion + "</A><BR></TD></TR>");
}
}
c_ctasconts.close();
if ( client.criteria == "cta_contable" )
writeln("</TABLE>");
}
if (!request.waux) {
writeSisgnature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

802
g_docpago.html Normal file
View File

@ -0,0 +1,802 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: g_docpago.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>Doc. Pago de facturas</TITLE>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT SRC="l_docpago.js">
</SCRIPT>
<SCRIPT SRC="nroletra.js">
</SCRIPT>
</HEAD>
<SERVER>
var NF09=""
var NFY9="";
var NF7="";
var NF10=""
var HOY=new Date();
// Algunos formatos para fechas.
var NLDF=""; // para columnas en las queries INFORMIX
var baseHtml="";
var nprinter="ep1170";
var spoolpath="";
var pathFile="c:/tmprpts/";
var nomFile=pathFile+request.uid+"_pag.html"; // Donde escribe el Server
var nomCarta=pathFile+request.uid+"_car.html";
var nomFich=pathFile+request.uid+"_fic.txt";
var nomTest=pathFile+request.uid+"_tst.html";
var nomList=pathFile+request.uid+"_lst.html";
var urlFile="file:///P|/"+request.uid+"_pag.html" // Donde leen los Clients
var urlCarta="file:///P|/"+request.uid+"_car.html"
var urlFich="file:///P|/"+request.uid+"_fic.txt"
var urlTest="file:///P|/"+request.uid+"_tst.html"
var urlList="file:///P|/"+request.uid+"_lst.html"
// Variable para Impresora y papel
var BodyLines=8; // Nro. Lins. del Cuerpo
var PaperLines=72; // Nro. Lins. del Papel Pagaré
var PaperTray=60; // Nro. Lins. del Papel Bandeja
var PaperTLines=74; // Nro. Lins. del Papel Talón
var HeadPosLin=20; // Nro. Lin. de Cabecera (luego del logo)
var FootPosLin=43; // Nro. Lin. del Pie (pagaré)
var CompLetOn=""; // Código on Letra comprimida
var CompLetOff=""; // Código off Letra comprimida
var LongLine=66; // Longitud de línea
var CarPad="-"; // Caracter de relleno
// Variables de traducción de dígitos -- Se ha fracasado con matrices en el SERVER
var mat_un_0="";
var mat_un_1="";
var mat_un_2="";
var mat_un_3="";
var mat_un_4="";
var mat_un_5="";
var mat_un_6="";
var mat_un_7="";
var mat_un_8="";
var mat_un_9="";
var mat_ud_0="";
var mat_ud_1="";
var mat_ud_2="";
var mat_ud_3="";
var mat_ud_4="";
var mat_ud_5="";
var mat_ud_6="";
var mat_ud_7="";
var mat_ud_8="";
var mat_ud_9="";
var mat_de_1="";
var mat_de_2="";
var mat_de_3="";
var mat_de_4="";
var mat_de_5="";
var mat_de_6="";
var mat_de_7="";
var mat_de_8="";
var mat_de_9="";
var mat_ce_1="";
var mat_ce_2="";
var mat_ce_3="";
var mat_ce_4="";
var mat_ce_5="";
var mat_ce_6="";
var mat_ce_7="";
var mat_ce_8="";
var mat_ce_9="";
var mat_mll_1="";
var mat_mll_2="";
var mat_mll_3="";
var mat_mll_4="";
var mat_mll_5="";
var mat_mll_6="";
var mat_mll_7="";
var mat_mll_8="";
var mat_mll_9="";
var let_ciens=""; // cientos
var let_cient=""; // ciento
var let_cien=""; // cien
var let_plus100=""; // ciento
var let_un=""; // un
var let_mil=""; // mil
var let_mill=""; // cadena "llón"
var let_mills=""; // cadena "llones"
var let_con=""; // con para decimales
var car_dec=""; // carácter decimales
var num_let=""; // resultado
var num_let2=""; // resultado
var tx_cent="";
var tx_dece="";
var tx_und="";
var tx_mll="";
var txletmll="";
var txletmil="";
var linPad="";
dbAcl();
if (request.doc_clean) {
cleanup_docspago();
redirect(addClient("g_docpago.html?"+baseHtml));
}
if (request.doc_pago) {
if (updPagoFras()) {
cleanup_docspago();
redirect(addClient("g_docpago.html?"+baseHtml));
}
}
if (request.doc_delete) {
// Borramos en tabla de pagos datos del usuario
if ( request.h_nro_doc != "0" ) {
criteria=" nro_doc_pago >= '"+NroUnformat(request.d_nro_doc)+"' and nro_doc_pago <= '"+NroUnformat(request.h_nro_doc)+"'";
} else {
criteria=" nro_doc_pago = '"+NroUnformat(request.d_nro_doc)+"'";
}
client.is_trans=true;
database.beginTransaction();
c_docspago = database.cursor("SELECT nro_reg FROM docspago WHERE uid='"+request.uid+"' and "+ criteria+" order by nro_reg ");
while (c_docspago.next()) {
// DesBloquear factura
status=database.execute("UPDATE facturas SET is_locked='' WHERE nro_reg='"+c_docspago.nro_reg+"'");
}
c_docspago.close();
status=database.execute("DELETE FROM docspago WHERE uid=\'" + request.uid+ "\' and "+criteria);
database.commitTransaction();
client.is_trans=false;
}
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons();GoField()"');
else
writeln(' <BODY OnLoad="GoField()"');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="factura.js">');
writeln('</SCRIPT>');
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln(' function GoField() {');
writeln(' var f=document.f_docpago; ');
writeln(' // nro_letra("2505480", "spa", "f", "Pesetas", "-", 54,68);');
writeln(' // alert("\\r"+num_let+"¡¡¡ !!!"); ');
if (!request.f_orden && !request.docpago && !request.opt_docpago && !request.test) {
if ( chk_docspago() == false )
writeln(' f.f_impdisp.focus();');
}
if (request.doc_list)
writeln("displayRptPagos();");
if (request.f_tipo_doc_pago == "2" && request.doc_carta)
writeln("displayRptCarta();");
if (request.f_tipo_doc_pago == "2" && request.doc_file)
writeln("displayRptFile();");
if (request.docpago)
writeln("displayReport();");
if (request.test)
writeln("displayRptTest();");
writeln(' }');
writeln(' function chkYearNroReg(obj) {');
writeln(' var nro=0; ');
writeln(' nro=parseInt(obj.value); ');
writeln(' if (nro+1 > 0 ) { ');
writeln(' obj.value=nro; ');
writeln(' if ( HOY.getFullYear() != nro ) ');
writeln(' alert("¡¡ El Año del Nro. de Registro no es el actual !! ");');
writeln(' }');
writeln(' }');
writeln('function NroPad(obj,longNro) {');
writeln(' if ( obj.value.length == 0 )');
writeln(' return;');
writeln(' if (obj.value.indexOf("*") >= 0) ');
writeln(' return;');
writeln(' c_nro=obj.value;');
writeln(' for (var j=c_nro.length ; j<longNro ; j++ ) {');
writeln(' c_nro="0"+c_nro;');
writeln(' }');
writeln(' obj.value=c_nro.substring(0,longNro);');
writeln('}');
writeln(' function Chek_fields(obj) {');
if (request.waux )
writeln(' return true;');
else if (!request.f_orden && !request.docpago && !request.opt_docpago && !request.test) {
writeln(' var importe_disp=0, importe_min=0, nro=0;');
writeln(' importe_disp=parseInt(NroUnformat(obj.f_impdisp.value));');
writeln(' if ( emptyField(obj.f_impdisp) == true || importe_disp <= 0 ) { ');
writeln(' alert("!!! El Disponible ha de ser mayor que 0 !!!->"+obj.f_impdisp.value+"<-");');
writeln(' return false;');
writeln(' }');
writeln(' if ( emptyField(obj.f_nro_doc) == true || parseInt(obj.f_nro_doc.value)<=0 ) { ');
writeln(' alert("!!! Es necesario rellenar el Nro. de Documento !!!->"+obj.f_nro_doc.value+"<-");');
writeln(' return false;');
writeln(' }');
writeln(' importe_min=parseInt(NroUnformat(obj.f_importe_min.value));');
writeln(' nro=importe_disp-importe_min;');
writeln(' if ( nro < 0 ) { ');
writeln(' alert("!!! El importe Disponible ha de ser mayor que el Mínimo a pagar !!!->"+nro+"<-");');
writeln(' return false;');
writeln(' }');
writeln(' return true;');
}
else if (request.f_orden && !request.test) {
writeln(' var sumaTotal=0, importe_disp=0, nro=0, pos=0;');
writeln(' sumaTotal=parseFloat(NroUnformat(obj.sumaTotal.value));');
writeln(' if ( sumaTotal <= 0 ) { ');
writeln(' alert("!!! EL importe total a pagar no puede ser 0 o menor que 0 !!!->"+sumaTotal+"<-");');
writeln(' return false;');
writeln(' }');
writeln(' importe_disp=parseInt(NroUnformat(obj.f_impdisp.value));');
writeln(' nro=sumaTotal-importe_disp;');
writeln(' if ( nro < 0 ) { ');
writeln(' alert("!!! El importe Disponible ha sido excedido en !!!->"+nro+"<-");');
writeln(' return false;');
writeln(' }');
writeln(' obj.sel_nro_reg.value="";');
writeln(' for (var i=0; i <obj.docpago.length; i++){ ');
writeln(' if (obj.docpago.options[i].selected) {');
writeln(' pos=obj.docpago.options[i].value.indexOf("|");');
writeln(' if (pos > 1) {');
writeln(' nro_reg=obj.docpago.options[i].value.substring(0,pos);');
writeln(' if (obj.sel_nro_reg.value.length > 0 ) ');
writeln(' obj.sel_nro_reg.value=obj.sel_nro_reg.value+"|"+nro_reg;');
writeln(' else ');
writeln(' obj.sel_nro_reg.value=nro_reg;');
writeln(' }');
writeln(' }');
writeln(' }');
writeln(' obj.sel_nro_reg.value=obj.sel_nro_reg.value+"|"');
writeln(' obj.sel_nro_reg2.value="";');
writeln(' if (obj.docpago2) { ') ;
writeln(' for (var i=0; i <obj.docpago2.length; i++){ ');
writeln(' if (obj.docpago2.options[i].selected) {');
writeln(' pos=obj.docpago2.options[i].value.indexOf("|");');
writeln(' if (pos > 1) {');
writeln(' nro_reg=obj.docpago2.options[i].value.substring(0,pos);');
writeln(' if (obj.sel_nro_reg2.value.length > 0 ) ');
writeln(' obj.sel_nro_reg2.value=obj.sel_nro_reg2.value+"|"+nro_reg;');
writeln(' else ');
writeln(' obj.sel_nro_reg2.value=nro_reg;');
writeln(' }');
writeln(' }');
writeln(' }');
writeln(' }');
writeln(' obj.sel_nro_reg.value=obj.sel_nro_reg.value+obj.sel_nro_reg2.value+"|"');
writeln(' obj.sel_nro_reg2.value="";');
writeln(' return true;');
}
else if (request.docpago) {
writeln(' if (confirm("!!! Confirmar Tarea !!!"))');
writeln(' return true;');
writeln(' else ');
writeln(' return false;');
}
writeln('}');
if (request.gofunc) {
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.f_docpago;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="g_docpago.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
}
writeln('</SCRIPT>');
if (request.docpago) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln("function displayReport() {");
report_docpago();
writeln("}");
writeln("</SCRIPT>");
}
if (request.doc_list) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln("function displayRptPagos() {");
rpt_docpago();
writeln("}");
writeln("</SCRIPT>");
}
if (request.f_tipo_doc_pago == "2" && request.doc_carta) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln("function displayRptCarta() {");
rpt_doccarta();
writeln("}");
writeln("</SCRIPT>");
}
if (request.f_tipo_doc_pago == "2" && request.doc_file) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln("function displayRptFile() {");
rpt_docfile();
writeln("}");
writeln("</SCRIPT>");
}
if (request.test) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln("function displayRptTest() {");
rpt_test();
writeln("}");
writeln("</SCRIPT>");
}
if( request.f_orden && !request.test) {
if (!request.gofunc) {
dbConnect();
LoadParametros();
var criterio=""
if ( request.f_desde.length > 0 ) {
var f_desde=DateFormat(request.f_desde,NLDF);
if ( f_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
criterio=" f_emision >= '"+f_desde+"' "
}
if ( request.f_hasta.length > 0 ) {
var f_hasta=DateFormat(request.f_hasta,NLDF);
if ( f_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" f_emision <= '"+f_hasta+"' "
}
if ( request.v_desde.length > 0 ) {
var v_desde=DateFormat(request.v_desde,NLDF);
if ( v_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" f_pago >= '"+v_desde+"' "
}
if ( request.v_hasta.length > 0 ) {
var v_hasta=DateFormat(request.v_hasta,NLDF);
if ( v_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" f_pago <= '"+v_hasta+"' "
}
if ( request.h_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.mes >= '"+request.d_mes_fra+"' and facturas.mes <= '"+request.h_mes_fra+"'"
} else {
if ( request.d_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.mes >= '"+request.d_mes_fra+"'"
}
}
if ( request.h_cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" cod_centro <= '"+request.d_cod_centro+"' and cod_centro >= '"+request.h_cod_centro+"' "
} else {
if ( request.d_cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" cod_centro matches '"+request.d_cod_centro+"'"
}
}
if ( request.nif.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nif matches '"+request.nif+"'"
}
if ( request.h_nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_fra >= '"+request.d_nro_fra+"' and facturas.nro_fra <= '"+request.h_nro_fra+"'"
} else {
if ( request.d_nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_fra >= '"+request.d_nro_fra+"'"
}
}
if ( request.h_nro_regn.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_reg >= '"+StringClip(true,request.d_nro_regy)+StringClip(true,request.d_nro_regn)+"' and facturas.nro_reg <= '"+StringClip(true,request.h_nro_regy)+StringClip(true,request.h_nro_regn)+"'"
} else {
if ( request.d_nro_regn.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_reg >= '"+StringClip(true,request.d_nro_regy)+StringClip(true,request.d_nro_regn)+"'"
}
}
if ( request.razon_social.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
var razon_social=request.razon_social;
// var lowcaps = request.razon_social.toLowerCase();
// var uppercaps = request.razon_social.toUpperCase();
criterio=criterio+"razon_social matches '"+razon_social+"'"
}
var nro=parseFloat(NroUnformat(request.f_importe_min));
critIMP="";
if ( nro > 0 ) {
critIMP=" and importe_total >= '"+nro+"'"
}
if (criterio.length > 0 )
criterio=" and "+criterio;
request.criterio=criterio;
c_facturas = database.cursor("SELECT * FROM facturas,proveedores,centros WHERE facturas.nif=proveedores.nif and facturas.cod_centro=centros.cod_centro "+
" and is_locked !='S' and f_emision_pago is null and proveedores.cond_pago != '"+client.pa_cp_lock+"'"+
" and tipo_doc_pago ='"+request.f_tipo_doc_pago+"' "+
" and facturas.cond_pago != '"+client.pa_cp_lock+"' and importe_total > 0 "+criterio +
critIMP+" ORDER BY " + request.f_orden);
}
// if (!c_facturas)
// DbsError(false,-1);
// else {
// writeln("<SCRIPT LANGUAGE='JavaScript'>");
// writeln("function displayReport() {");
// report_fra();
// writeln("}");
// writeln("</SCRIPT>");
// c_facturas.close();
// }
}
criterio="Doc. Pago";
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RangoFecha(obj,clave) {');
writeln(' if (obj.value.length > 0 ){ ');
writeln(' if (clave == "emision") { ');
writeln(' if (dateCmp(obj.value,document.f_docpago.f_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.f_docpago.f_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "vto") { ');
writeln(' if (dateCmp(obj.value,document.f_docpago.v_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.f_docpago.v_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "fecha") { ');
writeln(' if (dateCmp(obj.value,document.f_docpago.desde.value) != 1 ) {');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.f_docpago.desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' } ');
writeln('} ');
writeln('function HastaDefault(obj,clave) {');
writeln(' if (obj.value.length <= 0 ){ ');
writeln(' if (clave == "emision") ');
writeln(' obj.value=document.f_docpago.f_desde.value;');
writeln(' if (clave == "vto") ');
writeln(' obj.value=document.f_docpago.v_desde.value;');
writeln(' if (clave == "fecha") ');
writeln(' obj.value=document.f_docpago.desde.value;');
writeln(' } ');
writeln('} ');
writeln('function SumaTotal(obj) {');
writeln(' var f=document.f_docpago; ');
writeln(' var sumaTotal=0 ');
writeln(' var ndocs=0 ');
writeln(' for (var i=0; i <obj.length; i++){ ');
writeln(' if (obj.options[i].selected) {');
writeln(' ndocs++; ');
writeln(' var pos=obj.options[i].value.indexOf("|"); ');
writeln(' if (pos > 1) ');
writeln(' sumaTotal=sumaTotal+parseFloat(obj.options[i].value.substring(pos+1,obj.options[i].value.length))');
writeln(' } ');
writeln(' } ');
writeln(' f.sumaTotal.value=NroFormat(sumaTotal,NF9);');
writeln(' var impdisp=parseFloat(NroUnformat(f.f_impdisp[1].value));');
writeln(' f.totalDocs.value=ndocs;');
writeln(' var total=impdisp-sumaTotal ');
writeln(' if ( total<0 ) ');
writeln(' alert("¡ La suma total excede al disponible en:"+NroFormat(total*-1,NF9)+" !");');
writeln('} ');
writeln('function SumaTotal2(obj) {');
writeln(' var f=document.f_docpago; ');
writeln(' var sumaTotal2=0 ');
writeln(' var ndocs2=0 ');
writeln(' for (var i=0; i <obj.length; i++){ ');
writeln(' if (obj.options[i].selected) {');
writeln(' ndocs2++; ');
writeln(' var pos=obj.options[i].value.indexOf("|"); ');
writeln(' if (pos > 1) ');
writeln(' sumaTotal2=sumaTotal2+parseFloat(obj.options[i].value.substring(pos+1,obj.options[i].value.length))');
writeln(' } ');
writeln(' } ');
writeln(' f.sumaTotal2.value=NroFormat(sumaTotal2,NF9);');
writeln(' f.totalDocs2.value=ndocs2;');
writeln('} ');
writeln('</SCRIPT>');
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Facturas",criterio,"pag");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="g_docpago.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("Facturas",criterio,"rpt")
writeln('</FORM>');
}
writeln('<FORM NAME="f_docpago" method="Post" action="g_docpago.html?'+baseHtml+'" onSubmit="return Chek_fields(this)">');
}
}
else {
writeln('<FORM NAME="f_docpago" method="Post" action="g_docpago.html?waux='+request.waux+'&'+baseHtml+'" onSubmit="return Chek_fields(this)">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
if( !request.f_orden && !request.docpago && !request.opt_docpago) {
if (!request.nif)
request.nif="";
if (!request.d_cod_centro)
request.d_cod_centro="";
if (!request.h_cod_centro)
request.h_cod_centro="";
if (!request.razon_social)
request.razon_social="";
if (!request.d_nro_fra)
request.d_nro_fra="";
if (!request.h_nro_fra)
request.h_nro_fra="";
if (!request.f_desde)
request.f_desde="";
if (!request.f_hasta)
request.f_hasta="";
if (!request.v_desde)
request.v_desde="";
if (!request.v_hasta)
request.v_hasta="";
if (!request.d_mes_fra)
request.d_mes_fra="";
if (!request.h_mes_fra)
request.h_mes_fra="";
if (!request.d_nro_regn)
request.d_nro_regn="";
if (!request.d_nro_regy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.d_nro_regy=n;
}
if (!request.h_nro_regn)
request.h_nro_regn="";
if (!request.h_nro_regy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.h_nro_regy=n;
}
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TR><TD ALIGN=LEFT><B>Disponible:</B></TD>');
writeln('<TD><INPUT type="text" name="f_impdisp" VALUE="0" onBlur="NroToString(this,NF11)" onFocus="StringToNro(this,NF11)" SIZE=14></TD>');
writeln('<TD><SELECT NAME="f_cod_banco" SIZE=1>');
c_bancos = database.cursor("SELECT cod_banco,nombre FROM bancos where is_locked != 'S' ORDER BY cod_banco ");
while (c_bancos.next()) {
writeln('<OPTION VALUE="'+c_bancos.cod_banco+'" >'+c_bancos.nombre);
}
c_bancos.close();
writeln('</SELECT></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Localidad:</B></TD>');
writeln('<TD><INPUT type="text" name="f_cod_localidad" VALUE="MALAGA" size=12 maxlength=12></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Nro. Documento:</B></TD>');
writeln('<TD><INPUT type="text" name="f_nro_doc" onBlur="NroToString(this,NF11)" onFocus="StringToNro(this,NF11)" size=12 maxlength=12 VALUE="" ></TD></TR>');
writeln('<TR><TD ALIGN=LEFT></TD><TD><SELECT NAME="f_tipo_doc_pago" OnChange="//" SIZE=1><OPTION VALUE="1" SELECTED> Pagaré <OPTION VALUE="2"> Talón Bancario <OPTION VALUE="3"> Compensación <OPTION VALUE="4"> Domiciliación </SELECT></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Fecha Emisión:</B></TD>');
writeln('<TD><INPUT type="text" name="f_f_emision_pago" VALUE="'+set_hoy()+'" onBlur="ToStringDate(this,IFDF)" onFocus="UnfrmtStrDate(this,IFDF)" size=8 maxlength=8></TD></TR>');
writeln('</TABLE>');
writeln('<HR>');
writeln('<B>Criterios de Seleccion Datos: </B><BR>');
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('<TR><TD ALIGN=LEFT><B>Importe Superior a:</B></TD>');
writeln('<TD><INPUT type="text" name="f_importe_min" VALUE="0" onBlur="NroToString(this,NF11)" onFocus="StringToNro(this,NF11)" SIZE=14><INPUT TYPE="submit" value=" . "></TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Reg.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_regn" VALUE="'+request.d_nro_regn+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="d_nro_regy" VALUE="'+request.d_nro_regy+'" SIZE=4 OnChange="chkYearNroReg(this)">');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_regn" VALUE="'+request.h_nro_regn+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="h_nro_regy" VALUE="'+request.h_nro_regy+'" SIZE=4 OnChange="chkYearNroReg(this)"><INPUT TYPE="submit" value=" / "></TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Fra.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_fra" VALUE="'+request.d_nro_fra+'" SIZE=12 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_fra" VALUE="'+request.h_nro_fra+'" SIZE=12 > </TD>');
writeln("<TR><TD ALIGN=LEFT>N.I.F. .......: </TD><TD><INPUT type='text' name='nif' size=12 maxlength=12 VALUE='"+request.nif +"' onChange='this.value=this.value.toUpperCase()' > </TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Razón Social .: </TD><TD><INPUT type='text' name='razon_social' size=30 maxlength=40 VALUE='"+request.razon_social +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Código Centro Desde: </TD><TD><INPUT type='text' name='d_cod_centro' size=12 maxlength=12 VALUE='"+request.d_cod_centro +"' >");
writeln("Hasta: <INPUT type='text' name='h_cod_centro' size=12 maxlength=12 VALUE='"+request.h_cod_centro +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Emitida Desde: </TD><TD><INPUT type='text' name='f_desde' size=8 maxlength=10 VALUE='"+request.f_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='f_hasta' size=8 maxlength=10 VALUE='"+request.f_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"emision\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"emision\")' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Fecha. Pago Desde: </TD><TD><INPUT type='text' name='v_desde' size=8 maxlength=10 VALUE='"+request.v_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='v_hasta' size=8 maxlength=10 VALUE='"+request.v_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"vto\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"vto\")''></TD></TR>");
writeln('<TR><TD ALIGN=LEFT><B>Nro.Mes.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_mes_fra" VALUE="'+request.d_mes_fra+'" SIZE=2 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_mes_fra" VALUE="'+request.h_mes_fra+'" SIZE=2 > </TD>');
writeln('<TR><TD ALIGN=LEFT>Ordenado por: </TD><TD><SELECT NAME="f_orden" SIZE=1>');
writeln('<OPTION VALUE="razon_social" SELECTED>Razón Social');
writeln('<OPTION VALUE="facturas.nif" >N.I.F.');
writeln('<OPTION VALUE="nro_fra" >Nro.Fra. ');
writeln('<OPTION VALUE="nro_reg" >Nro.Reg. ');
writeln('<OPTION VALUE="f_emision" >Fecha Emisión');
writeln('<OPTION VALUE="vto_pago" >Vto. Pago');
writeln('<OPTION VALUE="cod_centro" >Centro ');
writeln('<OPTION VALUE="f_pago" >Fecha Pago ');
writeln('</SELECT></TD></TR>');
writeln('<TR><TD ALIGN=LEFT>Nro.Lin (test): </TD><TD><SELECT NAME="t_nl" SIZE=1>');
writeln('<OPTION VALUE="0" SELECTED>No');
writeln('<OPTION VALUE="1" >Si');
writeln('</SELECT></TD></TR></TABLE>');
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('<INPUT TYPE="submit" name="test" value="Test">');
writeln('</FORM>');
}
writeln("<CENTER>");
if (!request.waux) {
refHtml="g_docpago.html?"+baseHtml;
}
else {
refHtml="g_docpago.html?waux=1&"+baseHtml;
}
LoadHidden(refHtml);
if( request.f_orden && !request.test ) {
writeln("</CENTER>");
if (request.t_nl == "1")
writeln('<FONT COLOR="#800040" SIZE=+2><BLINK><B>TEST nro. Línea </B></BLINK></FONT>');
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TR><TD ALIGN=LEFT></TD><TD>');
if (request.f_cod_banco && request.f_cod_banco != null) {
CursorTabla("ba","cod_banco","=\'"+StringClip(true,request.f_cod_banco)+"\'",false,false);
request.f_t_nombre_banco=StringClip(false,c_bancos.nombre);
c_bancos.close();
}
else
request.f_t_nombre_banco="";
writeln('<TR><TD ALIGN=LEFT><B> Cód: <B>'+request.f_cod_banco+'</B></TD>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.f_t_nombre_banco+'</FONT></B><INPUT TYPE="hidden" NAME="f_cod_banco" VALUE="'+request.f_cod_banco+'" SIZE=4></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Disponible:</TD>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.f_impdisp+'</B></FONT><INPUT TYPE="hidden" NAME="f_impdisp" VALUE="'+request.f_impdisp+'" SIZE=14> </TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Localidad:</B></TD>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.f_cod_localidad+'</FONT><INPUT type="hidden" name="f_cod_localidad" VALUE="'+request.f_cod_localidad+'" size=12 maxlength=12></FONT></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Fecha Emisión:</B></TD>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.f_f_emision_pago+'</FONT><INPUT type="hidden" name="f_f_emision_pago" VALUE="'+request.f_f_emision_pago+'" size=8 maxlength=8></TD></FONT></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.</B>');
if (request.f_tipo_doc_pago=="1")
writeln('<FONT COLOR="#800040"><B> Pagaré </B></FONT>');
if (request.f_tipo_doc_pago=="2")
writeln('<FONT COLOR="#800040"><B> Talón </B></FONT>');
if (request.f_tipo_doc_pago=="3")
writeln('<FONT COLOR="#800040"><B> Compensación </B></FONT>');
if (request.f_tipo_doc_pago=="4")
writeln('<FONT COLOR="#800040"><B> Domiciliación </B></FONT>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.f_nro_doc+'</B></FONT><INPUT TYPE="hidden" NAME="f_nro_doc" VALUE="'+request.f_nro_doc+'">');
writeln('<INPUT TYPE="hidden" NAME="f_tipo_doc_pago" VALUE="'+request.f_tipo_doc_pago+'"></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Importe Superior a:</B></TD>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.f_importe_min+'</B></FONT><INPUT type="hidden" name="f_importe_min" VALUE="'+request.f_importe_min+'" SIZE=14></TD>');
writeln('<INPUT TYPE="hidden" NAME="t_nl" VALUE="'+request.t_nl+'"></TD></TR>');
writeln('</TABLE>');
writeln("<HR><CENTER>");
var suma_total=0;
var nrows=0;
while (c_facturas.next()) {
if ( nrows == 0 )
writeln('<SELECT NAME="docpago" OnChange="SumaTotal(this)" SIZE=10 MULTIPLE>');
nrows++;
LastRow=c_facturas.nro_reg;
//lista de todos los facturas devueltos por el cursor.
if ( (suma_total+c_facturas.importe_total) > NroUnformat(request.f_impdisp) )
continue ;
var linea=c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length)+"&nbsp&nbsp&nbsp";
linea=linea+NroFormat(c_facturas.importe_total,NF09)
linea=linea+"&nbsp&nbsp&nbsp"+
c_facturas.nif +"&nbsp&nbsp&nbsp"+
datetoString(c_facturas.f_pago) +"&nbsp&nbsp"+
c_facturas.razon_social.substring(0,20);
// "/" + c_facturas.nro_reg.substring(0,4) +" "+
// c_facturas.nro_fra +" "+
// datetoString(c_facturas.f_emision) +" "+
// datetoString(c_facturas.vto_pago) +" "+
// c_facturas.cod_centro +" "+
// writeln("<option>"+substChar(linea," ","&nbsp;")+"</option>");
writeln('<option value="'+c_facturas.nro_reg+'|'+c_facturas.importe_total+'">'+linea+'</option>');
suma_total=suma_total+c_facturas.importe_total;
if ( suma_total > NroUnformat(request.f_impdisp) )
break ;
}
c_facturas.close();
if ( nrows > 0 )
writeln('</SELECT>');
writeln('<HR>');
writeln('<INPUT TYPE="hidden" NAME="sel_nro_reg" VALUE="">');
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TD ALIGN=LEFT><B>Suma Total:</B><INPUT TYPE="text" NAME="sumaTotal" OnChange="SumaTotal(this)" VALUE="0" SIZE=12 ></TD>');
writeln('<TD ALIGN=RIGHT><B>Disponible:</B><FONT COLOR="#800040"><B>'+request.f_impdisp+'</B></FONT><INPUT TYPE="hidden" NAME="f_impdisp" VALUE="'+request.f_impdisp+'" SIZE=14> </TD>');
writeln('<TD ALIGN=LEFT><B>Nro. Docs:</B><INPUT TYPE="text" NAME="totalDocs" VALUE="0" OnChange="SumaTotal(this)" SIZE=3 ></TD><TR>');
writeln('</TABLE>');
writeln('<CENTER> <B><H3>Devoluciones</B></H3></CENTER>');
writeln('<HR>');
var suma_total2=0;
var nrows2=0;
c_facturas = database.cursor("SELECT * FROM facturas,proveedores,centros WHERE facturas.nif=proveedores.nif and facturas.cod_centro=centros.cod_centro "+
" and is_locked !='S' and f_emision_pago is null and proveedores.cond_pago != '"+client.pa_cp_lock+"'"+
" and tipo_doc_pago ='"+request.f_tipo_doc_pago+"' "+
" and facturas.cond_pago != '"+client.pa_cp_lock+"' "+request.criterio +
" and importe_total < 0 ORDER BY " + request.f_orden);
while (c_facturas.next()) {
if ( nrows2 == 0 )
writeln('<SELECT NAME="docpago2" OnChange="SumaTotal2(this)" SIZE=10 MULTIPLE>');
nrows2++;
LastRow=c_facturas.nro_reg;
var linea=c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length)+"&nbsp&nbsp&nbsp";
linea=linea+NroFormat(c_facturas.importe_total,NF09)
linea=linea+"&nbsp&nbsp&nbsp"+
c_facturas.nif +"&nbsp&nbsp&nbsp"+
datetoString(c_facturas.f_pago) +"&nbsp&nbsp"+
c_facturas.razon_social.substring(0,20);
// "/" + c_facturas.nro_reg.substring(0,4) +" "+
// c_facturas.nro_fra +" "+
// datetoString(c_facturas.f_emision) +" "+
// datetoString(c_facturas.vto_pago) +" "+
// c_facturas.cod_centro +" "+
// writeln("<option>"+substChar(linea," ","&nbsp;")+"</option>");
writeln('<option value="'+c_facturas.nro_reg+'|'+c_facturas.importe_total+'">'+linea+'</option>');
suma_total2=suma_total2+c_facturas.importe_total;
}
c_facturas.close();
if ( nrows2 > 0 )
writeln('</SELECT>');
writeln('<HR>');
writeln('<INPUT TYPE="hidden" NAME="sel_nro_reg2" VALUE="">');
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TD ALIGN=LEFT><B>Suma Total:</B><INPUT TYPE="text" NAME="sumaTotal2" OnChange="SumaTotal2(this)" VALUE="0" SIZE=12 ></TD>');
writeln('<TD ALIGN=LEFT><B>Nro. Docs:</B><INPUT TYPE="text" NAME="totalDocs2" VALUE="0" OnChange="SumaTotal2(this)" SIZE=3 ></TD><TR>');
writeln('</TABLE>');
writeln('<HR>');
writeln('<CENTER><INPUT TYPE="submit" value="Pagar Documentos"></CENTER>');
}
if (request.docpago || request.opt_docpago) {
writeln('<CENTER><INPUT TYPE="submit" name="doc_pago" value="Confirmar">');
writeln('<INPUT TYPE="submit" name="doc_clean" value="Deshacer">');
if (request.f_tipo_doc_pago == "2" ) {
writeln('<INPUT TYPE="submit" name="doc_carta" value="Carta">');
writeln('<INPUT TYPE="submit" name="doc_file" value="Fichero">');
}
writeln('<INPUT TYPE="submit" name="doc_list" value="Listar"></CENTER>');
writeln('<INPUT TYPE="hidden" NAME="opt_docpago" VALUE="0">');
writeln('<INPUT TYPE="hidden" NAME="f_tipo_doc_pago" VALUE="'+request.f_tipo_doc_pago+'">');
writeln('<BR><BR><LEFT><B>Documentos a Cancelar:</B>');
writeln('Desde<INPUT type="text" name="d_nro_doc" onBlur="NroToString(this,NF7)" onFocus="StringToNro(this,NF7)" size=9 maxlength=9 VALUE="" >');
writeln('Hasta<INPUT type="text" name="h_nro_doc" onBlur="NroToString(this,NF7)" onFocus="StringToNro(this,NF7)" size=9 maxlength=9 VALUE="" >');
writeln('<INPUT TYPE="submit" name="doc_delete" value="Cancelar">');
}
writeln('</FORM>');
if (!request.waux)
writeSignature(true);
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

550
g_factura.html Normal file
View File

@ -0,0 +1,550 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: g_factura.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>facturas</TITLE>
</HEAD>
<SERVER>
var NF9=""
var NF10=""
var HOY=new Date();
var linea="";
// Algunos formatos para fechas.
var NLDF=""; // para columnas en las queries INFORMIX
var baseHtml="";
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln(' <BODY');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln(' function chkYearNroReg(obj) {');
writeln(' var nro=parseInt(obj.value); ');
writeln(' if (nro+1 > 0 ) { ');
writeln(' obj.value=nro; ');
writeln(' if ( HOY.getFullYear() != nro ) ');
writeln(' alert("¡¡ El Año del Nro. de Registro no es el actual !! ");');
writeln(' }');
writeln(' }');
writeln('function NroPad(obj,longNro) {');
writeln(' if ( obj.value.length == 0 )');
writeln(' return;');
writeln(' if (obj.value.indexOf("*") >= 0) ');
writeln(' return;');
writeln(' c_nro=obj.value;');
writeln(' for (var j=c_nro.length ; j<longNro ; j++ ) {');
writeln(' c_nro="0"+c_nro;');
writeln(' }');
writeln(' obj.value=c_nro.substring(0,longNro);');
writeln('}');
if (request.gofunc) {
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_factura;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="o_factura.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
}
writeln('</SCRIPT>');
if(request.search1 || request.search2 || request.desde || request.hasta || request.f_orden) {
if (!request.gofunc) {
dbConnect();
// if(request.search1 || request.desde || request.hasta || request.multiple || request.f_orden) {
//Si se busca usando el texto de entrada
if (request.desde && request.hasta) {
var desde_fecha=DateFormat(request.desde,NLDF);
if ( desde_fecha.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
var hasta_fecha=DateFormat(request.hasta,NLDF);
if ( hasta_fecha.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
c_facturas = database.cursor("SELECT * FROM facturas,proveedores WHERE facturas.nif=proveedores.nif and "+ client.criteria +" Between '" +
desde_fecha + "' and '"+ hasta_fecha + "' ORDER BY " + client.criteria);
}
else if (request.search1) {
c_facturas = database.cursor("SELECT * FROM facturas,proveedores WHERE facturas.nif=proveedores.nif and "+ client.criteria +" MATCHES '" +
request.search1 + "' ORDER BY " + client.criteria);
}
else if (request.f_orden) {
var criterio=""
if ( request.f_desde.length > 0 ) {
var f_desde=DateFormat(request.f_desde,NLDF);
if ( f_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
criterio=" f_emision >= '"+f_desde+"' "
}
if ( request.f_hasta.length > 0 ) {
var f_hasta=DateFormat(request.f_hasta,NLDF);
if ( f_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" f_emision <= '"+f_hasta+"' "
}
if ( request.v_desde.length > 0 ) {
var v_desde=DateFormat(request.v_desde,NLDF);
if ( v_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago >= '"+v_desde+"' "
}
if ( request.v_hasta.length > 0 ) {
var v_hasta=DateFormat(request.v_hasta,NLDF);
if ( v_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago <= '"+v_hasta+"' "
}
if ( request.cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" cod_centro matches '"+request.cod_centro+"'"
}
if ( request.nif.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nif matches '"+request.nif+"'"
}
if ( request.nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_fra matches '"+request.nro_fra+"'"
}
if ( request.nro_regn.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_reg matches '"+StringClip(true,request.nro_regy)+StringClip(true,request.nro_regn)+"'"
}
if ( request.h_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.mes >= '"+request.d_mes_fra+"' and facturas.mes <= '"+request.h_mes_fra+"'"
} else {
if ( request.d_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.mes matches '"+request.d_mes_fra+"'"
}
}
if ( request.h_nro_doc_pago.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_doc_pago >= '"+request.d_nro_doc_pago+"' and facturas.nro_doc_pago <= '"+request.h_nro_doc_pago+"'"
} else {
if ( request.d_nro_doc_pago.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_doc_pago matches '"+request.d_nro_doc_pago+"'"
}
}
if ( request.razon_social.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
var razon_social=request.razon_social;
// var lowcaps = request.razon_social.toLowerCase();
// var uppercaps = request.razon_social.toUpperCase();
criterio=criterio+"razon_social matches '"+razon_social+"'"
}
c_facturas = database.cursor("SELECT * FROM facturas,proveedores WHERE facturas.nif=proveedores.nif and "+ criterio +
" ORDER BY " + request.f_orden);
}
if (!c_facturas)
DbsError(false,-1);
client.search1 = request.search1;
}
if(request.search2) {
if(request.search2 == "all") {
//Selecciono todos los facturas, sin criterio
c_facturas = database.cursor("SELECT * FROM facturas,proveedores where facturas.nif=proveedores.nif ORDER BY nro_reg ");
if (!c_facturas)
DbsError(false,-1);
}
else {
//Selecciona todas las filas en las que el descripcion empieza con la letra elejida.
var lowcaps = request.search2.toLowerCase();
c_facturas = database.cursor("SELECT * FROM facturas f,proveedores "+
" WHERE facturas.nif=proveedores.nif and "
+ client.criteria + " MATCHES '" + request.search2 + "*' OR " +
client.criteria +" MATCHES '" + lowcaps + "*'"+
" ORDER BY " + client.criteria);
if (!c_facturas)
DbsError(false,-1);
}
client.search2 = request.search2;
}
// }
}
else {
if (!request.nro_reg && !request.f_emision && !request.nif && !request.cod_centro ) {
request.multiple ="Múltiple";
}
}
if (request.fecha_emision) {
client.criteria="f_emision";
client.des_criteria="cuya fecha de emisión";
}
if (request.vto_pago) {
client.criteria="vto_pago";
client.des_criteria="cuyo vto. de pago";
}
if (request.multiple ) {
client.criteria="multiple";
client.des_criteria="según criterio de búsqueda ";
}
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RangoFecha(obj,clave) {');
writeln(' if (obj.value.length > 0 ){ ');
writeln(' if (clave == "emision") { ');
writeln(' if (dateCmp(obj.value,document.g_factura.f_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_factura.f_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "vto") { ');
writeln(' if (dateCmp(obj.value,document.g_factura.v_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_factura.v_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "fecha") { ');
writeln(' if (dateCmp(obj.value,document.g_factura.desde.value) != 1 ) {');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_factura.desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' } ');
writeln('} ');
writeln('function HastaDefault(obj,clave) {');
writeln(' if (obj.value.length <= 0 ){ ');
writeln(' if (clave == "emision") ');
writeln(' obj.value=document.g_factura.f_desde.value;');
writeln(' if (clave == "vto") ');
writeln(' obj.value=document.g_factura.v_desde.value;');
writeln(' if (clave == "fecha") ');
writeln(' obj.value=document.g_factura.desde.value;');
writeln(' } ');
writeln('} ');
writeln('</SCRIPT>');
criterio="criterio múltiple";
if ( client.criteria == "multiple")
criterio="criterio múltiple";
if ( client.criteria == "f_emision" )
criterio="por fecha emision";
if ( client.criteria == "vto_pago" )
criterio="por vto. de pago";
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Facturas",criterio,"fa_");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="o_factura.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("Facturas",criterio,"fa_")
writeln('</FORM>');
}
writeln('<FORM NAME="g_factura" method="Post" action="g_factura.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM NAME="g_factura" method="Post" action="g_factura.html?waux='+request.waux+'&'+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
writeln("<B>Cambiar Seleccion Datos por: </B>");
if ( client.criteria != "fecha_emision" )
writeln("<INPUT TYPE='submit' NAME='fecha_emision' value='F.Emisión'>");
if ( client.criteria != "vto_pago" )
writeln("<INPUT TYPE='submit' NAME='vto_pago' value='Vto.Pago'>");
if ( client.criteria != "multiple" )
writeln("<INPUT TYPE='submit' NAME='multiple' value='Múltiple'>");
writeln("<HR>");
if (client.criteria == "f_emision" || client.criteria == "vto_pago" || client.criteria == "multiple" ) {
if (client.criteria == "multiple" ) {
if (!request.nif)
request.nif="";
if (!request.cod_centro)
request.cod_centro="";
if (!request.razon_social)
request.razon_social="";
if (!request.nro_fra)
request.nro_fra="";
if (!request.f_desde)
request.f_desde="";
if (!request.f_hasta)
request.f_hasta="";
if (!request.v_desde)
request.v_desde="";
if (!request.v_hasta)
request.v_hasta="";
if (!request.nro_regn)
request.nro_regn="";
if (!request.d_mes_fra)
request.d_mes_fra="";
if (!request.h_mes_fra)
request.h_mes_fra="";
if (!request.d_nro_doc_pago)
request.d_nro_doc_pago="";
if (!request.h_nro_doc_pago)
request.h_nro_doc_pago="";
if (!request.nro_regy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.nro_regy=n;
}
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Reg.: </B></TD><TD><INPUT TYPE="text" NAME="nro_regn" VALUE="'+request.nro_regn+'" OnChange="NroPad(this,5)" SIZE=5 ><INPUT TYPE="submit" value=" / "><INPUT TYPE="text" NAME="nro_regy" VALUE="'+request.nro_regy+'" SIZE=4 OnChange="chkYearNroReg(this)"></TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Fra.: </B></TD><TD><INPUT TYPE="text" NAME="nro_fra" VALUE="'+request.nro_fra+'" SIZE=12 > </TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Mes.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_mes_fra" VALUE="'+request.d_mes_fra+'" SIZE=2 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_mes_fra" VALUE="'+request.h_mes_fra+'" SIZE=2 > </TD>');
writeln("<TR><TD ALIGN=LEFT>N.I.F. .......: </TD><TD><INPUT type='text' name='nif' size=12 maxlength=12 VALUE='"+request.nif +"' onChange='this.value=this.value.toUpperCase()' > </TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Razón Social .: </TD><TD><INPUT type='text' name='razon_social' size=30 maxlength=40 VALUE='"+request.razon_social +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Código Centro : </TD><TD><INPUT type='text' name='cod_centro' size=12 maxlength=12 VALUE='"+request.cod_centro +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Emitida Desde: </TD><TD><INPUT type='text' name='f_desde' size=8 maxlength=10 VALUE='"+request.f_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='f_hasta' size=8 maxlength=10 VALUE='"+request.f_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"emision\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"emision\")' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Vto. Pago Desde: </TD><TD><INPUT type='text' name='v_desde' size=8 maxlength=10 VALUE='"+request.v_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='v_hasta' size=8 maxlength=10 VALUE='"+request.v_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"vto\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"vto\")''></TD></TR>");
writeln('<TR><TD ALIGN=LEFT><B>Nro.Doc.Pago: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_doc_pago" VALUE="'+request.d_nro_doc_pago+'" SIZE=12 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_doc_pago" VALUE="'+request.h_nro_doc_pago+'" SIZE=12 > </TD>');
writeln('<TR><TD ALIGN=LEFT>Ordenado por: </TD><TD><SELECT NAME="f_orden" SIZE=1>');
writeln('<OPTION VALUE="razon_social" >Razón Social');
writeln('<OPTION VALUE="nif" >N.I.F.');
writeln('<OPTION VALUE="nro_fra" >Nro.Fra. ');
writeln('<OPTION VALUE="nro_reg" SELECTED>Nro.Reg. ');
writeln('<OPTION VALUE="f_emision" >Fecha Emisión');
writeln('<OPTION VALUE="vto_pago" >Vto. Pago');
writeln('<OPTION VALUE="cod_centro" >Centro ');
writeln('<OPTION VALUE="f_emision" >Fecha Pago ');
writeln('<OPTION VALUE="vto_pago" >Vto. Pago ');
writeln('</SELECT></TD></TR></SELECT></TABLE>');
}
else {
if (!request.desde)
request.desde="";
if (!request.hasta)
request.hasta="";
writeln("Desde: <INPUT type='text' name='desde' size=8 maxlength=10 VALUE='"+request.desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='hasta' size=8 maxlength=10 VALUE='"+request.hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"fecha\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"fecha\")' >");
}
}
else {
if(request.search1 == null)
writeln("<INPUT type='text' name='search1'>");
else
writeln("<INPUT type='text' name='search1' VALUE='" + request.search1 + "'>");
}
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('</FORM>');
if ( client.criteria == "multiple" )
writeln("<b>Según criterio </b>");
if ( client.criteria == "f_emision" )
writeln("<b>Fecha de Emisión entre:</b>");
if ( client.criteria == "vto_pago" )
writeln("<b>Fecha de Vto. Pago entre:</b>");
if ( client.criteria == "nro_reg" )
writeln("Número de Registro empieza por:<BR>")
writeln("<CENTER>");
if (!request.waux) {
refHtml="g_factura.html?"+baseHtml+"&search2=";
}
else {
refHtml="g_factura.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
if ( client.criteria != "f_emision" && client.criteria != "vto_pago" && client.criteria != "multiple" )
buttonsLetrasNros(refHtml,false);
writeln("</CENTER><HR>");
if (request.search1) {
if ( client.criteria == "f_emision" || client.criteria == "vto_pago" )
writeln("facturas "+ client.des_criteria +" entre <FONT SIZE=+2>" + request.desde + " - "+ request.hasta +" </FONT><BR>")
else
writeln("facturas "+ client.des_criteria +" contiene <FONT SIZE=+2>" + request.search1 + "</FONT><BR>")
}
if (request.search2) {
if(request.search2 == "all") {
writeln("Lista de todos los facturas<BR>");
}
else {
writeln("facturas " + client.des_criteria + " empieza por <FONT SIZE=+2>" + request.search2 + "</FONT><BR>");
}
}
writeln("<HR>");
if(request.search1 || request.search2 || request.desde || request.hasta || request.f_orden ) {
writeln('<TABLE ALIGN="CENTER" BORDER=1>');
var suma_total=0;
var nrows=0;
while (c_facturas.next()) {
nrows++;
LastRow=c_facturas.nro_reg;
//lista de todos los facturas devueltos por el cursor.
if ( client.criteria == "f_emision" ){
if (!request.waux)
writeln("<TR><TD ALIGN=RIGTH><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_factura.html"+
"?fa_nro_reg=" + escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
datetoString(c_facturas.f_emision) + "</TD><TD>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_factura.html?waux="+request.waux+
"&fa_nro_reg="+ escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A><BR></TD></TR>");
}
if ( client.criteria == "vto_pago" ){
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_factura.html"+
"?fa_nro_reg=" + escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_factura.html?waux="+request.waux+
"&fa_nro_reg="+ escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A><BR></TD></TR>");
}
if ( client.criteria == "nro_reg" ){
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_factura.html"+
"?fa_nro_reg=" + escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_factura.html?waux="+request.waux+
"&fa_nro_reg="+ escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A><BR></TD></TR>");
}
if ( client.criteria == "multiple") {
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_factura.html"+
"?fa_nro_reg=" + escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
StringClip(true,c_facturas.nro_fra) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision_pago) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
StringClip(true,c_facturas.cod_centro) + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif +
"</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_factura.html?waux="+request.waux+
"&fa_nro_reg="+ escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
StringClip(true,c_facturas.nro_fra) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision_pago) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
StringClip(true,c_facturas.cod_centro) + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif +
"</A><BR></TD></TR>");
}
suma_total=suma_total+c_facturas.importe_total;
}
c_facturas.close();
writeln("<TR><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD ALIGN=RIGHT></TD><TD ALIGN=RIGHT>----------------</TD>");
writeln("<TR><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD ALIGN=RIGHT>Suma Total:</TD><TD ALIGN=RIGHT>"+NroFormat(suma_total,NF10) +"</TD>");
writeln("</TABLE>");
if ( nrows == 1 )
redirect("o_factura.html?fa_nro_reg=" + escape(StringClip(false,LastRow))+"&"+baseHtml)
}
if (!request.waux)
writeSignature(true);
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

134
g_listados.html Normal file
View File

@ -0,0 +1,134 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: g_listados.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>Listado de facturas</TITLE>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
</HEAD>
<SERVER>
var NF9=""
var NF10=""
var HOY=new Date();
// Algunos formatos para fechas.
var NLDF=""; // para columnas en las queries INFORMIX
var baseHtml="";
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons();GoField()"');
else
writeln(' <BODY OnLoad="GoField()"');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="factura.js">');
writeln('</SCRIPT>');
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln(' function GoField() {');
writeln(' var f=document.l_factura; ');
writeln('// alert("\\r¡¡¡ !!!"); ');
if (!request.f_orden)
// writeln(' f.f_formato.focus();');
writeln(' }');
writeln(' function chkYearNroReg(obj) {');
writeln(' var nro=parseInt(obj.value); ');
writeln(' if (nro+1 > 0 ) { ');
writeln(' obj.value=nro; ');
writeln(' if ( HOY.getFullYear() != nro ) ');
writeln(' alert("¡¡ El Año del Nro. de Registro no es el actual !! ");');
writeln(' }');
writeln(' }');
if (request.gofunc) {
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_factura;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="o_factura.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
}
writeln('</SCRIPT>');
criterio="";
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Listados",criterio,"rpt");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="l_factura.html?'+baseHtml+'">');
QueryHeadBar("Listados",criterio,"rpt")
writeln('</FORM>');
}
writeln('<FORM NAME="l_factura" method="Post" action="l_factura.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM NAME="l_factura" method="Post" action="l_factura.html?waux='+request.waux+'&'+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
writeln('<P><BASE target="main"></P>');
writeln('<DT><B>&nbsp;<A HREF="l_factura.html?'+baseHtml+'"><IMG SRC="images/bullet_p.gif" BORDER=0 HEIGHT=14 WIDTH=31 ALIGN=BOTTOM></A><A HREF="l_factura.html?'+baseHtml+'">Facturas</A>&nbsp;</B></DT>');
writeln('<DT><B>&nbsp;</B></DT>');
writeln('<DT><B>&nbsp;<A HREF="l_albaran.html?'+baseHtml+'"><IMG SRC="images/bullet_p.gif" BORDER=0 HEIGHT=14 WIDTH=31 ALIGN=BOTTOM></A><A HREF="l_albaran.html?'+baseHtml+'">Albaranes Internos</A>&nbsp;</B></DT>');
writeln('<DT><B>&nbsp;</B></DT>');
writeln('<DT><B>&nbsp;<A HREF="l_proveedor.html?'+baseHtml+'"><IMG SRC="images/bullet_p.gif" BORDER=0 HEIGHT=14 WIDTH=31 ALIGN=BOTTOM></A><A HREF="l_proveedor.html?'+baseHtml+'">Proveedores</A>&nbsp;</B></DT>');
writeln('<DT><B>&nbsp;</B></DT>');
writeln('<DT><B>&nbsp;<A HREF="l_pedido.html?'+baseHtml+'"><IMG SRC="images/bullet_p.gif" BORDER=0 HEIGHT=14 WIDTH=31 ALIGN=BOTTOM></A><A HREF="l_pedido.html?'+baseHtml+'">Pedidos</A>&nbsp;</B></DT>');
writeln('<DT><B>&nbsp;</B></DT>');
writeln('<DT><B>&nbsp;<A HREF="l_prevision.html?'+baseHtml+'"><IMG SRC="images/bullet_p.gif" BORDER=0 HEIGHT=14 WIDTH=31 ALIGN=BOTTOM></A><A HREF="l_prevision.html?'+baseHtml+'">Previsiones</A>&nbsp;</B></DT>');
writeln('<DT><B>&nbsp;</B></DT>');
writeln('<HR>');
//writeln('<DT><B>&nbsp;<A HREF="l_docpago.html?'+baseHtml+'"><IMG SRC="images/bullet_p.gif" BORDER=0 HEIGHT=14 WIDTH=31 ALIGN=BOTTOM></A><A HREF="l_docpago.html?'+baseHtml+'">Documentos de Pago</A>&nbsp;</B></DT>');
//writeln('<DT><B>&nbsp;</B></DT>');
writeln("<CENTER>");
if (!request.waux) {
refHtml="g_listados.html?"+baseHtml;
}
else {
refHtml="g_listados.html?waux="+request.waux+"&"+baseHtml;
}
LoadHidden(refHtml);
if (!request.waux)
writeSignature(true);
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

208
g_localidad.html Normal file
View File

@ -0,0 +1,208 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: g_localidad.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>localidades</TITLE>
</HEAD>
<SERVER>
var baseHtml="";
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln(' <BODY');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
if (request.gofunc) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_localidad;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="o_localidad.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
writeln('</SCRIPT>');
}
if(request.search1 || request.search2) {
dbConnect();
if(request.search1 && !request.gofunc) {
//Si se busca usando el texto de entrada
c_localidades = database.cursor("SELECT * FROM localidades WHERE "+ client.criteria +" MATCHES '" + request.search1 + "' ORDER BY " + client.criteria);
if (!c_localidades)
DbsError(false,-1);
client.search1 = request.search1;
}
if(request.search2 && !request.gofunc) {
if(request.search2 == "all") {
//Selecciono todos los localidades, sin criterio
c_localidades = database.cursor("SELECT * FROM localidades ORDER BY "+client.criteria+" ");
if (!c_localidades)
DbsError(false,-1);
}
else {
//Selecciona todas las filas en las que el descripcion empieza con la letra elejida.
var lowcaps = request.search2.toLowerCase();
c_localidades = database.cursor("SELECT * FROM localidades WHERE "+ client.criteria + " MATCHES '" + request.search2 + "*' OR " + client.criteria +" MATCHES '" + lowcaps + "*' ORDER BY " + client.criteria);
if (!c_localidades)
DbsError(false,-1);
}
client.search2 = request.search2;
}
}
else {
if (!request.cod_localidad && !request.descripcion ) {
request.descripcion ="descripcion ";
}
}
if (request.cod_localidad) {
client.criteria="cod_localidad";
client.des_criteria="cuyo código";
}
if (request.descripcion ) {
client.criteria="descripcion ";
client.des_criteria="cuya descripción";
}
if ( client.criteria == "descripcion " )
criterio=" por descripcion ";
if ( client.criteria == "cod_localidad" )
criterio=" por Código ";
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("localidades",criterio,"lo_");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="o_localidad.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("localidades",criterio,"lo_");
writeln('</FORM>');
}
writeln('<FORM method="Post" NAME="g_localidad" action="g_localidad.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM method="Post" NAME="g_localidad" action="g_localidad.html?waux='+request.waux+'&'+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
if ( client.criteria == "descripcion " ) {
writeln("<B>Cambiar Seleccion Datos por: </B>");
writeln("<INPUT TYPE='submit' NAME='cod_localidad' value='Código'>");
writeln("<HR>");
writeln("<b>Descripción contiene:</b>");
}
if ( client.criteria == "cod_localidad" ) {
writeln("<B> Buscar por: </B>");
writeln("<INPUT TYPE='submit' NAME='descripcion ' value='Descripción'>");
writeln("<HR>");
writeln("<b>Código contiene:</b>");
}
if(request.search1 == null) {
writeln("<INPUT type='text' name='search1'>");
}
else {
writeln("<INPUT type='text' name='search1' VALUE='" + request.search1 + "'>");
}
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('</FORM>');
if (!client.criteria) {
client.criteria="descripcion ";
client.des_criteria="cuya descripción";
}
if ( client.criteria == "descripcion " ) {
client.des_criteria="cuya descripción";
writeln("Descripcion empieza por:</BR>")
}
if ( client.criteria == "cod_localidad" ) {
client.des_criteria="cuyo Código";
writeln("Código empieza por:<BR>")
}
writeln("<CENTER>");
if (!request.waux) {
refHtml="g_localidad.html?"+baseHtml+"&search2=";
}
else {
refHtml="g_localidad.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
buttonsLetrasNros(refHtml,true);
writeln("</CENTER><HR>");
if (request.search1) {
writeln("localidades "+ client.des_criteria +" contiene <FONT SIZE=+2>" + request.search1 + "</FONT><BR>")
}
if (request.search2) {
if(request.search2 == "all") {
writeln("Lista de todos los localidades<BR>");
}
else {
writeln("localidades " + client.des_criteria + " empieza por <FONT SIZE=+2>" + request.search2 + "</FONT><BR>");
}
}
writeln("<HR>");
if (request.search1 || request.search2) {
if ( client.criteria == "cod_localidad" )
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
while (c_localidades.next()) {
//lista de todos los localidades devueltos por el cursor.
if ( client.criteria == "descripcion " ) {
if (!request.waux)
writeln("<IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_localidad.html?lo_cod_localidad=" + escape(StringClip(false,c_localidades.cod_localidad))+"&"+baseHtml + "'>" + c_localidades.descripcion + "</A><BR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_localidad.html?waux="+request.waux+"&lo_cod_localidad="+ escape(StringClip(false,c_localidades.cod_localidad))+"&"+baseHtml + "'>" + c_localidades.cod_localidad + "</TD><TD>"+ c_localidades.descripcion + "</A><BR></TD></TR>");
}
if ( client.criteria == "cod_localidad" ) {
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_localidad.html?lo_cod_localidad=" + escape(StringClip(false,c_localidades.cod_localidad))+"&"+baseHtml + "'>" + c_localidades.cod_localidad + "</TD><TD>" +c_localidades.descripcion + "</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_localidad.html?waux="+request.waux+"&lo_cod_localidad="+ escape(StringClip(false,c_localidades.cod_localidad))+"&"+baseHtml + "'>" + c_localidades.cod_localidad + "</TD><TD>"+ c_localidades.descripcion + "</A><BR></TD></TR>");
}
}
c_localidades.close();
if ( client.criteria == "cod_localidad" )
writeln("</TABLE>");
}
if (!request.waux) {
writeSisgnature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

222
g_pedido.html Normal file
View File

@ -0,0 +1,222 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: g_pedido.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>Pedidos</TITLE>
</HEAD>
<SERVER>
var baseHtml="";
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln(' <BODY');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
if (request.gofunc) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_pedido;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="o_pedido.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
writeln('</SCRIPT>');
}
if(request.search1 || request.search2) {
dbConnect();
if(request.search1 && !request.gofunc) {
//Si se busca usando el texto de entrada
c_pedidos = database.cursor("SELECT * FROM pedidos WHERE "+ client.criteria +" MATCHES '" + request.search1 + "' ORDER BY " + client.criteria);
if (!c_pedidos)
DbsError(false,-1);
client.search1 = request.search1;
}
if(request.search2 && !request.gofunc) {
if(request.search2 == "all") {
//Selecciono todos los pedidos, sin criterio
c_pedidos = database.cursor("SELECT * FROM pedidos ORDER BY descripcion ");
if (!c_pedidos)
DbsError(false,-1);
}
else {
//Selecciona todas las filas en las que el descripcion empieza con la letra elejida.
var lowcaps = request.search2.toLowerCase();
c_pedidos = database.cursor("SELECT * FROM pedidos WHERE "+ client.criteria + " MATCHES '" + request.search2 + "*' OR " + client.criteria +" MATCHES '" + lowcaps + "*' ORDER BY " + client.criteria);
if (!c_pedidos)
DbsError(false,-1);
}
client.search2 = request.search2;
}
}
else {
if (!request.nro_pedido && !request.descripcion ) {
request.descripcion ="descripcion";
}
}
if (request.nro_pedido) {
client.criteria="nro_pedido";
client.des_criteria="cuyo número";
}
if (request.descripcion ) {
client.criteria="descripcion ";
client.des_criteria="cuya descripción";
}
if ( client.criteria == "descripcion " )
criterio=" por descripción ";
if ( client.criteria == "nro_pedido" )
criterio=" por número ";
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Pedidos",criterio,"pe_");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="o_pedido.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("Pedidos",criterio,"pe_")
writeln('</FORM>');
}
writeln('<FORM method="Post" NAME="g_pedido" action="g_pedido.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM method="Post" NAME="g_pedido" action="g_pedido.html?waux='+request.waux+'&'+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
if ( client.criteria == "descripcion " ) {
writeln("<B>Cambiar Seleccion Datos por: </B>");
writeln("<INPUT TYPE='submit' NAME='nro_pedido' value='número'>");
writeln("<HR>");
writeln("<b>Descripción contiene:</b>");
}
if ( client.criteria == "nro_pedido" ) {
writeln("<B> Buscar por: </B>");
writeln("<INPUT TYPE='submit' NAME='descripcion' value='Descripción'>");
writeln("<HR>");
writeln("<b>Número contiene:</b>");
}
if(request.search1 == null) {
writeln("<INPUT type='text' name='search1'>");
}
else {
writeln("<INPUT type='text' name='search1' VALUE='" + request.search1 + "'>");
}
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('</FORM>');
if (!client.criteria) {
client.criteria="descripcion ";
client.des_criteria="cuya descripción";
}
if ( client.criteria == "descripcion " ) {
client.des_criteria="cuya descripción";
writeln("Descripcion empieza por:</BR>")
}
if ( client.criteria == "nro_pedido" ) {
client.des_criteria="cuyo número";
writeln("Número empieza por:<BR>")
}
writeln("<CENTER>");
if (!request.waux) {
refHtml="g_pedido.html?"+baseHtml+"&search2=";
}
else {
refHtml="g_pedido.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
buttonsLetrasNros(refHtml,false);
writeln("</CENTER><HR>");
if (request.search1) {
writeln("pedidos "+ client.des_criteria +" contiene <FONT SIZE=+2>" + request.search1 + "</FONT><BR>")
}
if (request.search2) {
if(request.search2 == "all") {
writeln("Lista de todos los pedidos<BR>");
}
else {
writeln("pedidos " + client.des_criteria + " empieza por <FONT SIZE=+2>" + request.search2 + "</FONT><BR>");
}
}
writeln("<HR>");
if (request.search1 || request.search2) {
if ( client.criteria == "nro_pedido" )
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
var nrows=0;
while (c_pedidos.next()) {
nrows++;
LastRow=c_pedidos.nro_pedido;
//lista de todos los pedidos devueltos por el cursor.
if (request.pe_nif_proveedor && request.pe_nif_proveedor != null ) {
CursorTabla("pr","nif","=\'"+StringClip(true,request.pe_nif_proveedor)+"\'",false,false);
request.pe_t_razon_social=c_proveedores.razon_social;
c_proveedores.close();
}
else
request.pe_t_razon_social="";
if ( client.criteria == "descripcion " ) {
if (!request.waux)
writeln("<IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_pedido.html?pe_nro_pedido=" + escape(StringClip(false,c_pedidos.nro_pedido))+"&"+baseHtml + "'>" + c_pedidos.descripcion+" "+request.pe_t_razon_social+"</A><BR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_pedido.html?waux="+request.waux+"&pe_nro_pedido="+ escape(StringClip(false,c_pedidos.nro_pedido))+"&"+baseHtml + "'>" + c_pedidos.nro_pedido + "</TD><TD>"+ c_pedidos.descripcion +" "+request.pe_t_razon_social+ "</A><BR></TD></TR>");
}
if ( client.criteria == "nro_pedido" ) {
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_pedido.html?pe_nro_pedido=" + escape(StringClip(false,c_pedidos.nro_pedido))+"&"+baseHtml + "'>" + c_pedidos.nro_pedido + "</TD><TD>" +c_pedidos.descripcion +" "+request.pe_t_razon_social+ "</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_pedido.html?waux="+request.waux+"&pe_nro_pedido="+ escape(StringClip(false,c_pedidos.nro_pedido))+"&"+baseHtml + "'>" + c_pedidos.nro_pedido + "</TD><TD>"+ c_pedidos.descripcion +" "+request.pe_t_razon_social+ "</A><BR></TD></TR>");
}
}
c_pedidos.close();
if ( client.criteria == "nro_pedido" )
writeln("</TABLE>");
if ( nrows == 1 )
redirect("o_pedido.html?pe_nro_pedido=" + escape(StringClip(false,LastRow))+"&"+baseHtml)
}
if (!request.waux) {
writeSignature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

214
g_proveedor.html Normal file
View File

@ -0,0 +1,214 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: g_proveedor.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>Proveedores</TITLE>
</HEAD>
<SERVER>
var baseHtml="";
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln(' <BODY');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
if (request.gofunc) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_proveedor;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="o_proveedor.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
writeln('</SCRIPT>');
}
if(request.search1 || request.search2) {
dbConnect();
if(request.search1 && !request.gofunc) {
//Si se busca usando el texto de entrada
c_proveedores = database.cursor("SELECT * FROM proveedores WHERE "+ client.criteria +" MATCHES '" + request.search1 + "' ORDER BY " + client.criteria);
if (!c_proveedores)
DbsError(false,-1);
client.search1 = request.search1;
}
if(request.search2 && !request.gofunc) {
if(request.search2 == "all") {
//Selecciono todos los proveedores, sin criterio
c_proveedores = database.cursor("SELECT * FROM proveedores ORDER BY razon_social");
if (!c_proveedores)
DbsError(false,-1);
}
else {
//Selecciona todas las filas en las que el nombre empieza con la letra elejida.
var lowcaps = request.search2.toLowerCase();
c_proveedores = database.cursor("SELECT * FROM proveedores WHERE "+ client.criteria + " MATCHES '" + request.search2 + "*' OR " + client.criteria +" MATCHES '" + lowcaps + "*' ORDER BY " + client.criteria);
if (!c_proveedores)
DbsError(false,-1);
}
client.search2 = request.search2;
}
}
else {
if (!request.nif && !request.razon_social) {
request.razon_social="razon_social";
}
}
if (request.nif) {
client.criteria="nif";
client.des_criteria="cuya N.I.F.";
}
if (request.razon_social) {
client.criteria="razon_social";
client.des_criteria="cuya razón social";
}
if ( client.criteria == "razon_social" ) {
criterio=" por Razón Social ";
}
if ( client.criteria == "nif" ) {
criterio=" por N.I.F. ";
}
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Proveedores",criterio,"pr_");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="o_proveedor.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("Proveedores",criterio,"pr_")
writeln('</FORM>');
}
writeln('<FORM method="Post" NAME="g_proveedor" ACTION="g_proveedor.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM method="Post" NAME="g_proveedor" ACTION="g_proveedor.html?waux='+request.waux+'&'+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
if ( client.criteria == "razon_social" ) {
writeln("<B>Cambiar Seleccion Datos por: </B>");
writeln("<INPUT TYPE='submit' NAME='nif' value='N.I.F.'>");
writeln("<HR>");
writeln("<b>Razón Social contiene:</b>");
}
if ( client.criteria == "nif" ) {
writeln("<B> Buscar por: </B>");
writeln("<INPUT TYPE='submit' NAME='razon_social' value='Razón Social'>");
writeln("<HR>");
writeln("<b>N.I.F. contiene:</b>");
}
if(request.search1 == null) {
writeln("<INPUT type='text' name='search1'>");
}
else {
writeln("<INPUT type='text' name='search1' VALUE='" + request.search1 + "'>");
}
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('</FORM>');
if (!client.criteria) {
client.criteria="razon_social";
client.des_criteria="cuya razón social";
}
if ( client.criteria == "razon_social" ) {
client.des_criteria="cuya razón social";
writeln("Razón Social empieza por:</BR>")
}
if ( client.criteria == "nif" ) {
client.des_criteria="cuyo N.I.F";
writeln("N.I.F. empieza por:<BR>")
}
writeln("<CENTER>");
if (!request.waux) {
refHtml="g_proveedor.html?"+baseHtml+"&search2=";
}
else {
refHtml="g_proveedor.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
buttonsLetrasNros(refHtml,false);
writeln("</CENTER><HR>");
if (request.search1) {
writeln("Proveedores "+ client.des_criteria +" contiene <FONT SIZE=+2>" + request.search1 + "</FONT><BR>")
}
if (request.search2) {
if(request.search2 == "all") {
writeln("Lista de todos los proveedores<BR>");
}
else {
writeln("Proveedores " + client.des_criteria + " empieza por <FONT SIZE=+2>" + request.search2 + "</FONT><BR>");
}
}
writeln("<HR>");
if (request.search1 || request.search2) {
if ( client.criteria == "nif" )
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
var nrows=0;
while (c_proveedores.next()) {
nrows++;
LastRow=c_proveedores.nif;
//lista de todos los proveedores devueltos por el cursor.
if ( client.criteria == "razon_social" ) {
if (!request.waux)
writeln("<IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_proveedor.html?pr_nif=" + escape(StringClip(false,c_proveedores.nif))+"&"+baseHtml + "'>" + c_proveedores.razon_social + "</A><BR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_proveedor.html?waux="+request.waux+"&pr_nif="+escape(StringClip(false,c_proveedores.nif))+"&"+baseHtml + "'>" + c_proveedores.nif + "</TD><TD>"+ c_proveedores.razon_social + "</A><BR></TD></TR>");
}
if ( client.criteria == "nif" ) {
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_proveedor.html?pr_nif=" +escape(StringClip(false,c_proveedores.nif))+"&"+baseHtml + "'>" + c_proveedores.nif + "</TD><TD>" +c_proveedores.razon_social + "</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_proveedor.html?waux="+request.waux+"&pr_nif="+escape(StringClip(false,c_proveedores.nif))+"&"+baseHtml + "'>" + c_proveedores.nif + "</TD><TD>"+ c_proveedores.razon_social + "</A><BR></TD></TR>");
}
}
c_proveedores.close();
if ( client.criteria == "nif" )
writeln("</TABLE>");
if ( nrows == 1 )
redirect("o_proveedor.html?pr_nif=" + escape(StringClip(false,LastRow))+"&"+baseHtml)
}
if (!request.waux) {
writeSignature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

578
g_trasp_old.html Normal file
View File

@ -0,0 +1,578 @@
<!---
application: Cuentas a Traspasar
version: 1.0.0
filename: g_traspaso.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>Traspaso de facturas</TITLE>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT SRC="l_traspaso.js">
</SCRIPT>
</HEAD>
<SERVER>
vto_dtal="40100000";
vto_dpag="40100000";
vto_h="57200000";
vto_clave="11 ";
pag_htal="57200000";
pag_hpag="40100000";
pag_clave="11 ";
var NF09=""
var NFY9="";
var NF7="";
var NF10=""
var HOY=new Date();
// Algunos formatos para fechas.
var NLDF=""; // para columnas en las queries INFORMIX
var baseHtml="";
var pathFile="c:/tmprpts/";
var nomDoc=pathFile; // Donde escribe el Server
var nomData=pathFile;
var MES="";
if ( request.f_emision) {
var pos=request.f_emision.indexOf("/")
var lastPos=request.f_emision.substring(pos+1,request.f_emision.length).indexOf("/");
if ( lastPos == -1 )
MES = "";
else {
lastPos=pos+lastPos+1;
MES = request.f_emision.substring(pos+1,lastPos);
}
} else
var MES=HOY.getMonth()+1;
debug(MES);
nomDoc=nomDoc+request.f_traspaso+MES+".html";
nomData=nomData+request.f_traspaso+MES+".txt";
var urlDoc="file:///P|/"+request.f_traspaso+MES+".html" // Donde leen los Clients
var urlData="file:///P|/"+request.f_traspaso+MES+".txt"
// Direcciones Finales de Campos para traspaso
var p_nro_doc=6;
var p_nro_lin=12;
var p_f_cont=19;
var p_f_emis=26;
var p_centro=32;
var p_cta=41;
var p_tipo_apte=43;
var p_importe=55;
var p_clave=60;
var p_concepto=91;
var p_vto=98;
var p_contracta=107;
var SumaDebe=0;
var SumaHaber=0;
// Variable para Impresora y papel
var PaperLines=72; // Nro. Lins. del Papel
var PaperTray=60; // Nro. Lins. del Papel Bandeja
var LongLine=66; // Longitud de línea
//
dbAcl();
//if ((!request.waux && request.lock) || request.nvo )
LoadParametros();
writeln("<SCRIPT LANGUAGE='JavaScript'>");
//if ((!request.waux && request.lock) || request.nvo )
SetParametros();
writeln("</SCRIPT>");
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons();GoField()"');
else
writeln(' <BODY OnLoad="GoField()"');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="factura.js">');
writeln('</SCRIPT>');
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln(' function GoField() {');
writeln(' var f=document.f_traspaso; ');
if (!request.f_orden && !request.traspaso && !request.opt_traspaso ) {
if ( chk_traspaso() == false )
writeln(' f.f_traspaso.focus();');
}
if (request.doc_list)
writeln("displayRptDoc();");
if (request.data_list )
writeln("displayRptData();");
if (request.traspaso) {
writeln("displayReport();");
}
writeln(' }');
writeln(' function chkYearNroReg(obj) {');
writeln(' var nro=parseInt(obj.value); ');
writeln(' if (nro+1 > 0 ) { ');
writeln(' obj.value=nro; ');
writeln(' if ( HOY.getFullYear() != nro ) ');
writeln(' alert("¡¡ El Año del Nro. de Registro no es el actual !! ");');
writeln(' }');
writeln(' }');
writeln('function NroPad(obj,longNro) {');
writeln(' if ( obj.value.length == 0 )');
writeln(' return;');
writeln(' if (obj.value.indexOf("*") >= 0) ');
writeln(' return;');
writeln(' c_nro=obj.value;');
writeln(' for (var j=c_nro.length ; j<longNro ; j++ ) {');
writeln(' c_nro="0"+c_nro;');
writeln(' }');
writeln(' obj.value=c_nro.substring(0,longNro);');
writeln('}');
writeln(' function Chek_fields(obj) {');
if (request.waux )
writeln(' return true;');
else if (request.f_orden ) {
writeln(' if ( emptyField(obj.f_nro_doc) == true || parseInt(obj.f_nro_doc.value)<=0 ) { ');
writeln(' alert("!!! Es necesario rellenar el Nro. de Documento !!!->"+obj.f_nro_doc.value+"<-");');
writeln(' return false;');
writeln(' }');
writeln(' if ( parseInt(obj.totalDocs.value) <=0 ) { ');
writeln(' alert("!!! No hay Documentos disponibles para el Traspaso de ->"+obj.f_traspaso.value+"<- !!!");');
writeln(' return false;');
writeln(' }');
writeln(' return true;');
}
else if (request.traspaso) {
writeln(' if (confirm("!!! Confirmar Tarea !!!"))');
writeln(' return true;');
writeln(' else ');
writeln(' return false;');
}
writeln('}');
if (request.gofunc) {
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.f_traspaso;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="g_traspaso.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
}
writeln('</SCRIPT>');
if (request.traspaso) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln("function displayReport() {");
request.sel_cols="nro_reg";
if (request.f_traspaso=="pago") {
request.sel_order="nro_doc_pago,"+request.sel_order
request.sel_cols="nro_doc_pago";
}
if (request.f_traspaso=="vto") {
request.sel_order="nro_doc_pago,nro_reg_vto,"+request.sel_order
request.sel_cols="nro_reg_vto";
}
c_traspdocs = database.cursor("SELECT unique "+request.sel_cols+" FROM facturas,proveedores WHERE facturas.nif=proveedores.nif "+
" and "+request.criterio +
" ORDER BY " + request.sel_cols);
// " and is_locked !='S' and "+request.criterio +
report_traspaso();
writeln("}");
writeln("</SCRIPT>");
}
if (request.doc_list) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln("function displayRptDoc() {");
rpt_traspaso_Doc();
writeln("}");
writeln("</SCRIPT>");
}
if (request.data_list) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln("function displayRptData() {");
rpt_traspaso_Data();
writeln("}");
writeln("</SCRIPT>");
}
if( request.f_orden ) {
if (!request.gofunc) {
dbConnect();
LoadParametros();
var criterio=""
if ( request.f_desde.length > 0 ) {
var f_desde=DateFormat(request.f_desde,NLDF);
if ( f_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
criterio=" f_emision_pago >= '"+f_desde+"' "
}
if ( request.f_hasta.length > 0 ) {
var f_hasta=DateFormat(request.f_hasta,NLDF);
if ( f_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" f_emision_pago <= '"+f_hasta+"' "
}
if ( request.v_desde.length > 0 ) {
var v_desde=DateFormat(request.v_desde,NLDF);
if ( v_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" f_pago >= '"+v_desde+"' "
}
if ( request.v_hasta.length > 0 ) {
var v_hasta=DateFormat(request.v_hasta,NLDF);
if ( v_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" f_pago <= '"+v_hasta+"' "
}
if ( request.h_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.mes >= '"+request.d_mes_fra+"' and facturas.mes <= '"+request.h_mes_fra+"'"
} else {
if ( request.d_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.mes = '"+request.d_mes_fra+"'"
}
}
if ( request.h_cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" cod_centro <= '"+request.d_cod_centro+"' and cod_centro >= '"+request.h_cod_centro+"' "
} else {
if ( request.d_cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" cod_centro matches '"+request.d_cod_centro+"'"
}
}
if ( request.nif.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nif matches '"+request.nif+"'"
}
if ( request.h_nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_fra >= '"+request.d_nro_fra+"' and facturas.nro_fra <= '"+request.h_nro_fra+"'"
} else {
if ( request.d_nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_fra = '"+request.d_nro_fra+"'"
}
}
if ( request.h_nro_regn.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_reg >= '"+StringClip(true,request.d_nro_regy)+StringClip(true,request.d_nro_regn)+"' and facturas.nro_reg <= '"+StringClip(true,request.h_nro_regy)+StringClip(true,request.h_nro_regn)+"'"
} else {
if ( request.d_nro_regn.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_reg = '"+StringClip(true,request.d_nro_regy)+StringClip(true,request.d_nro_regn)+"'"
}
}
if ( request.razon_social.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
var razon_social=request.razon_social;
// var lowcaps = request.razon_social.toLowerCase();
// var uppercaps = request.razon_social.toUpperCase();
criterio=criterio+"razon_social matches '"+razon_social+"'"
}
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+"traspaso_"+request.f_traspaso+" != 'S' "
if ( request.f_traspaso == "vto" ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago is not null and nro_reg_vto not matches ' *' "
}
if ( request.f_traspaso == "pago" ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago is not null "
}
request.criterio=criterio;
}
}
criterio="Traspaso";
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RangoFecha(obj,clave) {');
writeln(' if (obj.value.length > 0 ){ ');
writeln(' if (clave == "emision") { ');
writeln(' if (dateCmp(obj.value,document.f_traspaso.f_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.f_traspaso.f_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "vto") { ');
writeln(' if (dateCmp(obj.value,document.f_traspaso.v_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.f_traspaso.v_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "fecha") { ');
writeln(' if (dateCmp(obj.value,document.f_traspaso.desde.value) != 1 ) {');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.f_traspaso.desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' } ');
writeln('} ');
writeln('function HastaDefault(obj,clave) {');
writeln(' if (obj.value.length <= 0 ){ ');
writeln(' if (clave == "emision") ');
writeln(' obj.value=document.f_traspaso.f_desde.value;');
writeln(' if (clave == "vto") ');
writeln(' obj.value=document.f_traspaso.v_desde.value;');
writeln(' if (clave == "fecha") ');
writeln(' obj.value=document.f_traspaso.desde.value;');
writeln(' } ');
writeln('} ');
writeln('</SCRIPT>');
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Traspaso",criterio,"tra");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="g_traspaso.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("Traspaso",criterio,"tra")
writeln('</FORM>');
}
writeln('<FORM NAME="f_traspaso" method="Post" action="g_traspaso.html?'+baseHtml+'" onSubmit="return Chek_fields(this)">');
}
}
else {
writeln('<FORM NAME="f_traspaso" method="Post" action="g_traspaso.html?waux='+request.waux+'&'+baseHtml+'" onSubmit="return Chek_fields(this)">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
if( !request.f_orden && !request.traspaso && !request.opt_traspaso) {
if (!request.nif)
request.nif="";
if (!request.d_cod_centro)
request.d_cod_centro="";
if (!request.h_cod_centro)
request.h_cod_centro="";
if (!request.razon_social)
request.razon_social="";
if (!request.d_nro_fra)
request.d_nro_fra="";
if (!request.h_nro_fra)
request.h_nro_fra="";
if (!request.f_desde)
request.f_desde="";
if (!request.f_hasta)
request.f_hasta="";
if (!request.v_desde)
request.v_desde="";
if (!request.v_hasta)
request.v_hasta="";
if (!request.d_mes_fra)
request.d_mes_fra="";
if (!request.h_mes_fra)
request.h_mes_fra="";
if (!request.d_nro_regn)
request.d_nro_regn="";
if (!request.d_nro_regy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.d_nro_regy=n;
}
if (!request.h_nro_regn)
request.h_nro_regn="";
if (!request.h_nro_regy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.h_nro_regy=n;
}
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TR><TD ALIGN=LEFT><B>Traspaso de:</B></TD><TD><SELECT NAME="f_traspaso" OnChange="" SIZE=1><OPTION VALUE="gasto" SELECTED> Gasto <OPTION VALUE="pago"> Pago <OPTION VALUE="vto"> Vencimiento </SELECT></TD></TR>');
writeln('</TABLE>');
writeln('<HR>');
writeln('<B>Criterios de Seleccion Datos: </B><BR>');
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Reg.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_regn" VALUE="'+request.d_nro_regn+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="d_nro_regy" VALUE="'+request.d_nro_regy+'" SIZE=4 OnChange="chkYearNroReg(this)">');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_regn" VALUE="'+request.h_nro_regn+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="h_nro_regy" VALUE="'+request.h_nro_regy+'" SIZE=4 OnChange="chkYearNroReg(this)"><INPUT TYPE="submit" value=" / "></TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Fra.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_fra" VALUE="'+request.d_nro_fra+'" SIZE=12 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_fra" VALUE="'+request.h_nro_fra+'" SIZE=12 > </TD>');
writeln("<TR><TD ALIGN=LEFT>N.I.F. .......: </TD><TD><INPUT type='text' name='nif' size=12 maxlength=12 VALUE='"+request.nif +"' onChange='this.value=this.value.toUpperCase()' > </TD></TR>");
writeln("<TR><TD ALIGN=LEFT><FONT COLOR='#800040'>Razón Social .:</FONT> </TD><TD><INPUT type='text' name='razon_social' size=30 maxlength=40 VALUE='"+request.razon_social +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Código Centro Desde: </TD><TD><INPUT type='text' name='d_cod_centro' size=12 maxlength=12 VALUE='"+request.d_cod_centro +"' >");
writeln("Hasta: <INPUT type='text' name='h_cod_centro' size=12 maxlength=12 VALUE='"+request.h_cod_centro +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Pago Emitido Desde: </TD><TD><INPUT type='text' name='f_desde' size=8 maxlength=10 VALUE='"+request.f_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='f_hasta' size=8 maxlength=10 VALUE='"+request.f_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"emision\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"emision\")' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Fecha. Pago Desde: </TD><TD><INPUT type='text' name='v_desde' size=8 maxlength=10 VALUE='"+request.v_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='v_hasta' size=8 maxlength=10 VALUE='"+request.v_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"vto\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"vto\")''></TD></TR>");
writeln('<TR><TD ALIGN=LEFT><B>Nro.Mes.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_mes_fra" VALUE="'+request.d_mes_fra+'" SIZE=2 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_mes_fra" VALUE="'+request.h_mes_fra+'" SIZE=2 > </TD>');
writeln('<TR><TD ALIGN=LEFT>Ordenado por: </TD><TD><SELECT NAME="f_orden" SIZE=1>');
writeln('<OPTION VALUE="razon_social" >Razón Social');
writeln('<OPTION VALUE="facturas.nif" >N.I.F.');
writeln('<OPTION VALUE="nro_fra" >Nro.Fra. ');
writeln('<OPTION VALUE="nro_reg" SELECTED >Nro.Reg. ');
writeln('<OPTION VALUE="f_emision" >Fecha Emisión');
writeln('<OPTION VALUE="vto_pago" >Vto. Pago');
writeln('<OPTION VALUE="cod_centro" >Centro ');
writeln('<OPTION VALUE="f_pago" >Fecha Pago ');
writeln('</SELECT></TD></TR>');
writeln('</SELECT></TD></TR></TABLE>');
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('</FORM>');
}
writeln("<CENTER>");
if (!request.waux) {
refHtml="g_traspaso.html?"+baseHtml;
}
else {
refHtml="g_traspaso.html?waux=1&"+baseHtml;
}
LoadHidden(refHtml);
if( request.f_orden ) {
writeln("</CENTER>");
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TR><TD ALIGN=LEFT><B>Nro. Documento:</B></TD>');
writeln('<TD><INPUT type="text" name="f_nro_doc" onBlur="NroToString(this,NF11)" onFocus="StringToNro(this,NF11)" size=12 maxlength=12 VALUE="" ></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Fecha Emisión:</B></TD>');
writeln('<TD><INPUT type="text" name="f_emision" VALUE="'+set_hoy()+'" onBlur="ToStringDate(this,IFDF)" onFocus="UnfrmtStrDate(this,IFDF)" size=8 maxlength=8></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Traspaso </B></TD>');
if (request.f_traspaso=="gasto")
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Gasto </B></FONT>');
if (request.f_traspaso=="pago")
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Pago </B></FONT>');
if (request.f_traspaso=="vto")
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Vencimiento </B></FONT>');
writeln('</TR>');
writeln('<INPUT TYPE="hidden" NAME="f_traspaso" VALUE="'+request.f_traspaso+'"></TD></TR>');
if (request.f_traspaso=="pago") {
writeln('<TR><TD ALIGN=LEFT><B>Cod. Cta. Abono Talones:</B></TD>');
writeln('<TD><INPUT type="text" name="pag_htal" VALUE="'+pag_htal+'" OnChange="CtaNroPad(this)" SIZE='+client.pa_longcta+' ></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Cod. Cta. Abono Pagarés:</B></TD>');
writeln('<TD><INPUT type="text" name="pag_hpag" VALUE="'+pag_hpag+'" OnChange="CtaNroPad(this)" SIZE='+client.pa_longcta+' ></TD></TR>');
request.f_clave=pag_clave;
}
if (request.f_traspaso=="vto") {
writeln('<TR><TD ALIGN=LEFT><B>Cod. Cta. Debe Talones:</B></TD>');
writeln('<TD><INPUT type="text" name="vto_dtal" VALUE="'+vto_dtal+'" OnChange="CtaNroPad(this)" SIZE='+client.pa_longcta+' ></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Cod. Cta. Debe Pagarés:</B></TD>');
writeln('<TD><INPUT type="text" name="vto_dpag" VALUE="'+vto_dpag+'" OnChange="CtaNroPad(this)" SIZE='+client.pa_longcta+' ></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Cod. Cta. Haber:</B></TD>');
writeln('<TD><INPUT type="text" name="vto_h" VALUE="'+vto_h+'" OnChange="CtaNroPad(this)" SIZE='+client.pa_longcta+' ></TD></TR>');
request.f_clave=vto_clave;
}
if (request.f_traspaso !="gasto") {
writeln('<TR><TD ALIGN=LEFT><B>Clave:</B></TD>');
writeln('<TD><INPUT type="text" name="f_clave" VALUE="'+request.f_clave+'" OnChange="CtaNroPad(this)" SIZE='+client.pa_longcta+' ></TD></TR>');
}
writeln('</TABLE>');
writeln("<HR><CENTER>");
writeln('<INPUT TYPE="hidden" NAME="criterio" VALUE="'+request.criterio+'"></TD></TR>');
writeln('<INPUT TYPE="hidden" NAME="sel_order" VALUE="'+request.f_orden+'"></TD></TR>');
request.totalDocs=0;
request.sumaTotal=0;
// query = database.cursor("SELECT count(*),sum(importe_total) FROM facturas,proveedores WHERE facturas.nif=proveedores.nif "+
if (request.f_traspaso=="vto")
query = database.cursor("SELECT count(unique nro_reg_vto) FROM facturas,proveedores WHERE facturas.nif=proveedores.nif "+
" and "+request.criterio);
if (request.f_traspaso=="pago")
query = database.cursor("SELECT count(unique nro_doc_pago) FROM facturas,proveedores WHERE facturas.nif=proveedores.nif "+
" and "+request.criterio);
if (request.f_traspaso=="gasto")
query = database.cursor("SELECT count(unique nro_reg) FROM facturas,proveedores WHERE facturas.nif=proveedores.nif "+
" and "+request.criterio);
if (query.next()) {
request.totalDocs=query[0];
// request.sumaTotal=query[1];
}
query.close();
writeln('<HR>');
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
// writeln('<TD ALIGN=LEFT><B>Suma Total:</B><INPUT TYPE="text" NAME="sumaTotal" OnChange="" VALUE="'+NroFormat(request.sumaTotal,NF11)+'" SIZE=12 ></TD>');
writeln('<TD ALIGN=LEFT><B>Nro. Docs:</B><INPUT TYPE="text" NAME="totalDocs" VALUE="'+NroFormat(request.totalDocs,NF7)+'" OnChange="" SIZE=12 ></TD><TR>');
writeln('</TABLE>');
writeln('<HR>');
writeln('<CENTER><INPUT TYPE="submit" name="traspaso" value="Traspasar Documentos"></CENTER>');
}
if (request.doc_clean) {
cleanup_traspaso();
redirect(addClient("g_traspaso.html?"+baseHtml));
}
if (request.doc_traspaso) {
if (request.f_traspaso!="gasto")
status=database.execute("UPDATE facturas SET traspaso_"+request.f_traspaso+"='S', is_locked='S' WHERE "+request.criterio);
if (request.f_traspaso=="gasto")
status=database.execute("UPDATE facturas SET traspaso_"+request.f_traspaso+"='S', is_locked='N' WHERE "+request.criterio);
cleanup_traspaso();
redirect(addClient("g_traspaso.html?"+baseHtml));
}
if (request.traspaso || request.opt_traspaso) {
writeln('<CENTER><INPUT TYPE="submit" name="doc_traspaso" value="Confirmar">');
writeln('<INPUT TYPE="submit" name="doc_clean" value="Deshacer">');
writeln('<INPUT TYPE="submit" name="data_list" value="Fichero">');
writeln('<INPUT TYPE="submit" name="doc_list" value="Listar"></CENTER>');
writeln('<INPUT TYPE="hidden" NAME="opt_traspaso" VALUE="0">');
writeln('<INPUT TYPE="hidden" NAME="f_traspaso" VALUE="'+request.f_traspaso+'">');
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TR><TD ALIGN=LEFT><B>Fecha Emisión:</B></TD>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.f_emision+'</FONT><INPUT type="hidden" name="f_emision" VALUE="'+request.f_emision+'" size=8 maxlength=8></TD></FONT></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Traspaso </B></TD>');
if (request.f_traspaso=="gasto")
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Gasto </B></FONT>');
if (request.f_traspaso=="pago")
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Pago </B></FONT>');
if (request.f_traspaso=="vto")
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Vencimiento </B></FONT>');
writeln('</TR>');
writeln('<TR><TD ALIGN=LEFT><B>Nro. Documento:</B>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.f_nro_doc+'</B></FONT><INPUT TYPE="hidden" NAME="f_nro_doc" VALUE="'+request.f_nro_doc+'">');
writeln('</TABLE>');
writeln('<INPUT TYPE="hidden" NAME="criterio" VALUE="'+request.criterio+'"></TD></TR>');
writeln('<INPUT TYPE="hidden" NAME="totalDocs" VALUE="'+request.totalDocs+'"></TD></TR>');
}
writeln('</FORM>');
if (!request.waux)
writeSignature(true);
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

566
g_traspaso.html Normal file
View File

@ -0,0 +1,566 @@
<!---
application: Cuentas a Traspasar
version: 1.0.0
filename: g_traspaso.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>Traspaso de facturas</TITLE>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT SRC="l_traspaso.js">
</SCRIPT>
</HEAD>
<SERVER>
vto_dtal="40100000";
vto_dpag="40100000";
vto_h="57200000";
vto_clave="11 ";
pag_htal="57200000";
pag_hpag="40100000";
pag_clave="11 ";
var NF09=""
var NFY9="";
var NF7="";
var NF10=""
var HOY=new Date();
// Algunos formatos para fechas.
var NLDF=""; // para columnas en las queries INFORMIX
var baseHtml="";
var pathFile="c:/tmprpts/";
var nomDoc=pathFile; // Donde escribe el Server
var nomData=pathFile;
var MES="";
if ( request.f_emision) {
var pos=request.f_emision.indexOf("/")
var lastPos=request.f_emision.substring(pos+1,request.f_emision.length).indexOf("/");
if ( lastPos == -1 )
MES = "";
else {
lastPos=pos+lastPos+1;
MES = request.f_emision.substring(pos+1,lastPos);
}
} else
var MES=HOY.getMonth()+1;
debug(MES);
nomDoc=nomDoc+request.f_traspaso+MES+".html";
nomData=nomData+request.f_traspaso+MES+".txt";
var urlDoc="file:///P|/"+request.f_traspaso+MES+".html" // Donde leen los Clients
var urlData="file:///P|/"+request.f_traspaso+MES+".txt"
var jusnum="";
var SumaDebe=0;
var SumaHaber=0;
// Variable para Impresora y papel
var PaperLines=72; // Nro. Lins. del Papel
var PaperTray=60; // Nro. Lins. del Papel Bandeja
var LongLine=66; // Longitud de línea
//
dbAcl();
//if ((!request.waux && request.lock) || request.nvo )
LoadParametros();
writeln("<SCRIPT LANGUAGE='JavaScript'>");
//if ((!request.waux && request.lock) || request.nvo )
SetParametros();
writeln("</SCRIPT>");
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons();GoField()"');
else
writeln(' <BODY OnLoad="GoField()"');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="factura.js">');
writeln('</SCRIPT>');
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln(' function GoField() {');
writeln(' var f=document.f_traspaso; ');
if (!request.f_orden && !request.traspaso && !request.opt_traspaso ) {
if ( chk_traspaso() == false )
writeln(' f.f_traspaso.focus();');
}
if (request.doc_list)
writeln("displayRptDoc();");
if (request.data_list )
writeln("displayRptData();");
if (request.traspaso) {
writeln("displayReport();");
}
writeln(' }');
writeln(' function chkYearNroReg(obj) {');
writeln(' var nro=parseInt(obj.value); ');
writeln(' if (nro+1 > 0 ) { ');
writeln(' obj.value=nro; ');
writeln(' if ( HOY.getFullYear() != nro ) ');
writeln(' alert("¡¡ El Año del Nro. de Registro no es el actual !! ");');
writeln(' }');
writeln(' }');
writeln('function NroPad(obj,longNro) {');
writeln(' if ( obj.value.length == 0 )');
writeln(' return;');
writeln(' if (obj.value.indexOf("*") >= 0) ');
writeln(' return;');
writeln(' c_nro=obj.value;');
writeln(' for (var j=c_nro.length ; j<longNro ; j++ ) {');
writeln(' c_nro="0"+c_nro;');
writeln(' }');
writeln(' obj.value=c_nro.substring(0,longNro);');
writeln('}');
writeln(' function Chek_fields(obj) {');
if (request.waux )
writeln(' return true;');
else if (request.f_orden ) {
writeln(' if ( emptyField(obj.f_nro_doc) == true || parseInt(obj.f_nro_doc.value)<=0 ) { ');
writeln(' alert("!!! Es necesario rellenar el Nro. de Documento !!!->"+obj.f_nro_doc.value+"<-");');
writeln(' return false;');
writeln(' }');
writeln(' if ( parseInt(obj.totalDocs.value) <=0 ) { ');
writeln(' alert("!!! No hay Documentos disponibles para el Traspaso de ->"+obj.f_traspaso.value+"<- !!!");');
writeln(' return false;');
writeln(' }');
writeln(' return true;');
}
else if (request.traspaso) {
writeln(' if (confirm("!!! Confirmar Tarea !!!"))');
writeln(' return true;');
writeln(' else ');
writeln(' return false;');
}
writeln('}');
if (request.gofunc) {
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.f_traspaso;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="g_traspaso.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
}
writeln('</SCRIPT>');
if (request.traspaso) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln("function displayReport() {");
request.sel_cols="nro_reg";
if (request.f_traspaso=="pago") {
request.sel_order="nro_doc_pago,"+request.sel_order
request.sel_cols="nro_doc_pago";
}
if (request.f_traspaso=="vto") {
request.sel_order="nro_doc_pago,nro_reg_vto,"+request.sel_order
request.sel_cols="nro_reg_vto";
}
c_traspdocs = database.cursor("SELECT unique "+request.sel_cols+" FROM facturas,proveedores WHERE facturas.nif=proveedores.nif "+
" and "+request.criterio +
" ORDER BY " + request.sel_cols);
// " and is_locked !='S' and "+request.criterio +
report_traspaso();
writeln("}");
writeln("</SCRIPT>");
}
if (request.doc_list) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln("function displayRptDoc() {");
rpt_traspaso_Doc();
writeln("}");
writeln("</SCRIPT>");
}
if (request.data_list) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln("function displayRptData() {");
rpt_traspaso_Data();
writeln("}");
writeln("</SCRIPT>");
}
if( request.f_orden ) {
if (!request.gofunc) {
dbConnect();
LoadParametros();
var criterio=""
if ( request.f_desde.length > 0 ) {
var f_desde=DateFormat(request.f_desde,NLDF);
if ( f_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
criterio=" f_emision_pago >= '"+f_desde+"' "
}
if ( request.f_hasta.length > 0 ) {
var f_hasta=DateFormat(request.f_hasta,NLDF);
if ( f_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" f_emision_pago <= '"+f_hasta+"' "
}
if ( request.v_desde.length > 0 ) {
var v_desde=DateFormat(request.v_desde,NLDF);
if ( v_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" f_pago >= '"+v_desde+"' "
}
if ( request.v_hasta.length > 0 ) {
var v_hasta=DateFormat(request.v_hasta,NLDF);
if ( v_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" f_pago <= '"+v_hasta+"' "
}
if ( request.h_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.mes >= '"+request.d_mes_fra+"' and facturas.mes <= '"+request.h_mes_fra+"'"
} else {
if ( request.d_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.mes = '"+request.d_mes_fra+"'"
}
}
if ( request.h_cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" cod_centro <= '"+request.d_cod_centro+"' and cod_centro >= '"+request.h_cod_centro+"' "
} else {
if ( request.d_cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" cod_centro matches '"+request.d_cod_centro+"'"
}
}
if ( request.nif.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nif matches '"+request.nif+"'"
}
if ( request.h_nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_fra >= '"+request.d_nro_fra+"' and facturas.nro_fra <= '"+request.h_nro_fra+"'"
} else {
if ( request.d_nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_fra = '"+request.d_nro_fra+"'"
}
}
if ( request.h_nro_regn.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_reg >= '"+StringClip(true,request.d_nro_regy)+StringClip(true,request.d_nro_regn)+"' and facturas.nro_reg <= '"+StringClip(true,request.h_nro_regy)+StringClip(true,request.h_nro_regn)+"'"
} else {
if ( request.d_nro_regn.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_reg = '"+StringClip(true,request.d_nro_regy)+StringClip(true,request.d_nro_regn)+"'"
}
}
if ( request.razon_social.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
var razon_social=request.razon_social;
// var lowcaps = request.razon_social.toLowerCase();
// var uppercaps = request.razon_social.toUpperCase();
criterio=criterio+"razon_social matches '"+razon_social+"'"
}
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+"traspaso_"+request.f_traspaso+" != 'S' "
if ( request.f_traspaso == "vto" ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago is not null and nro_reg_vto not matches ' *' "
}
if ( request.f_traspaso == "pago" ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago is not null "
}
request.criterio=criterio;
}
}
criterio="Traspaso";
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RangoFecha(obj,clave) {');
writeln(' if (obj.value.length > 0 ){ ');
writeln(' if (clave == "emision") { ');
writeln(' if (dateCmp(obj.value,document.f_traspaso.f_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.f_traspaso.f_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "vto") { ');
writeln(' if (dateCmp(obj.value,document.f_traspaso.v_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.f_traspaso.v_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "fecha") { ');
writeln(' if (dateCmp(obj.value,document.f_traspaso.desde.value) != 1 ) {');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.f_traspaso.desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' } ');
writeln('} ');
writeln('function HastaDefault(obj,clave) {');
writeln(' if (obj.value.length <= 0 ){ ');
writeln(' if (clave == "emision") ');
writeln(' obj.value=document.f_traspaso.f_desde.value;');
writeln(' if (clave == "vto") ');
writeln(' obj.value=document.f_traspaso.v_desde.value;');
writeln(' if (clave == "fecha") ');
writeln(' obj.value=document.f_traspaso.desde.value;');
writeln(' } ');
writeln('} ');
writeln('</SCRIPT>');
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Traspaso",criterio,"tra");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="g_traspaso.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("Traspaso",criterio,"tra")
writeln('</FORM>');
}
writeln('<FORM NAME="f_traspaso" method="Post" action="g_traspaso.html?'+baseHtml+'" onSubmit="return Chek_fields(this)">');
}
}
else {
writeln('<FORM NAME="f_traspaso" method="Post" action="g_traspaso.html?waux='+request.waux+'&'+baseHtml+'" onSubmit="return Chek_fields(this)">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
if( !request.f_orden && !request.traspaso && !request.opt_traspaso) {
if (!request.nif)
request.nif="";
if (!request.d_cod_centro)
request.d_cod_centro="";
if (!request.h_cod_centro)
request.h_cod_centro="";
if (!request.razon_social)
request.razon_social="";
if (!request.d_nro_fra)
request.d_nro_fra="";
if (!request.h_nro_fra)
request.h_nro_fra="";
if (!request.f_desde)
request.f_desde="";
if (!request.f_hasta)
request.f_hasta="";
if (!request.v_desde)
request.v_desde="";
if (!request.v_hasta)
request.v_hasta="";
if (!request.d_mes_fra)
request.d_mes_fra="";
if (!request.h_mes_fra)
request.h_mes_fra="";
if (!request.d_nro_regn)
request.d_nro_regn="";
if (!request.d_nro_regy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.d_nro_regy=n;
}
if (!request.h_nro_regn)
request.h_nro_regn="";
if (!request.h_nro_regy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.h_nro_regy=n;
}
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TR><TD ALIGN=LEFT><B>Traspaso de:</B></TD><TD><SELECT NAME="f_traspaso" OnChange="" SIZE=1><OPTION VALUE="gasto" SELECTED> Gasto <OPTION VALUE="pago"> Pago <OPTION VALUE="vto"> Vencimiento </SELECT></TD></TR>');
writeln('</TABLE>');
writeln('<HR>');
writeln('<B>Criterios de Seleccion Datos: </B><BR>');
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Reg.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_regn" VALUE="'+request.d_nro_regn+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="d_nro_regy" VALUE="'+request.d_nro_regy+'" SIZE=4 OnChange="chkYearNroReg(this)">');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_regn" VALUE="'+request.h_nro_regn+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="h_nro_regy" VALUE="'+request.h_nro_regy+'" SIZE=4 OnChange="chkYearNroReg(this)"><INPUT TYPE="submit" value=" / "></TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Fra.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_fra" VALUE="'+request.d_nro_fra+'" SIZE=12 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_fra" VALUE="'+request.h_nro_fra+'" SIZE=12 > </TD>');
writeln("<TR><TD ALIGN=LEFT>N.I.F. .......: </TD><TD><INPUT type='text' name='nif' size=12 maxlength=12 VALUE='"+request.nif +"' onChange='this.value=this.value.toUpperCase()' > </TD></TR>");
writeln("<TR><TD ALIGN=LEFT><FONT COLOR='#800040'>Razón Social .:</FONT> </TD><TD><INPUT type='text' name='razon_social' size=30 maxlength=40 VALUE='"+request.razon_social +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Código Centro Desde: </TD><TD><INPUT type='text' name='d_cod_centro' size=12 maxlength=12 VALUE='"+request.d_cod_centro +"' >");
writeln("Hasta: <INPUT type='text' name='h_cod_centro' size=12 maxlength=12 VALUE='"+request.h_cod_centro +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Pago Emitido Desde: </TD><TD><INPUT type='text' name='f_desde' size=8 maxlength=10 VALUE='"+request.f_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='f_hasta' size=8 maxlength=10 VALUE='"+request.f_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"emision\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"emision\")' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Fecha. Pago Desde: </TD><TD><INPUT type='text' name='v_desde' size=8 maxlength=10 VALUE='"+request.v_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='v_hasta' size=8 maxlength=10 VALUE='"+request.v_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"vto\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"vto\")''></TD></TR>");
writeln('<TR><TD ALIGN=LEFT><B>Nro.Mes.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_mes_fra" VALUE="'+request.d_mes_fra+'" SIZE=2 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_mes_fra" VALUE="'+request.h_mes_fra+'" SIZE=2 > </TD>');
writeln('<TR><TD ALIGN=LEFT>Ordenado por: </TD><TD><SELECT NAME="f_orden" SIZE=1>');
writeln('<OPTION VALUE="razon_social" >Razón Social');
writeln('<OPTION VALUE="facturas.nif" >N.I.F.');
writeln('<OPTION VALUE="nro_fra" >Nro.Fra. ');
writeln('<OPTION VALUE="nro_reg" SELECTED >Nro.Reg. ');
writeln('<OPTION VALUE="f_emision" >Fecha Emisión');
writeln('<OPTION VALUE="vto_pago" >Vto. Pago');
writeln('<OPTION VALUE="cod_centro" >Centro ');
writeln('<OPTION VALUE="f_pago" >Fecha Pago ');
writeln('</SELECT></TD></TR>');
writeln('</SELECT></TD></TR></TABLE>');
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('</FORM>');
}
writeln("<CENTER>");
if (!request.waux) {
refHtml="g_traspaso.html?"+baseHtml;
}
else {
refHtml="g_traspaso.html?waux=1&"+baseHtml;
}
LoadHidden(refHtml);
if( request.f_orden ) {
writeln("</CENTER>");
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TR><TD ALIGN=LEFT><B>Nro. Documento:</B></TD>');
writeln('<TD><INPUT type="text" name="f_nro_doc" onBlur="NroToString(this,NF11)" onFocus="StringToNro(this,NF11)" size=12 maxlength=12 VALUE="" ></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Fecha Emisión:</B></TD>');
writeln('<TD><INPUT type="text" name="f_emision" VALUE="'+set_hoy()+'" onBlur="ToStringDate(this,IFDF)" onFocus="UnfrmtStrDate(this,IFDF)" size=8 maxlength=8></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Traspaso </B></TD>');
if (request.f_traspaso=="gasto")
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Gasto </B></FONT>');
if (request.f_traspaso=="pago")
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Pago </B></FONT>');
if (request.f_traspaso=="vto")
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Vencimiento </B></FONT>');
writeln('</TR>');
writeln('<INPUT TYPE="hidden" NAME="f_traspaso" VALUE="'+request.f_traspaso+'"></TD></TR>');
if (request.f_traspaso=="pago") {
writeln('<TR><TD ALIGN=LEFT><B>Cod. Cta. Abono Talones:</B></TD>');
writeln('<TD><INPUT type="text" name="pag_htal" VALUE="'+pag_htal+'" OnChange="CtaNroPad(this)" SIZE='+client.pa_longcta+' ></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Cod. Cta. Abono Pagarés:</B></TD>');
writeln('<TD><INPUT type="text" name="pag_hpag" VALUE="'+pag_hpag+'" OnChange="CtaNroPad(this)" SIZE='+client.pa_longcta+' ></TD></TR>');
request.f_clave=pag_clave;
}
if (request.f_traspaso=="vto") {
writeln('<TR><TD ALIGN=LEFT><B>Cod. Cta. Debe Talones:</B></TD>');
writeln('<TD><INPUT type="text" name="vto_dtal" VALUE="'+vto_dtal+'" OnChange="CtaNroPad(this)" SIZE='+client.pa_longcta+' ></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Cod. Cta. Debe Pagarés:</B></TD>');
writeln('<TD><INPUT type="text" name="vto_dpag" VALUE="'+vto_dpag+'" OnChange="CtaNroPad(this)" SIZE='+client.pa_longcta+' ></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Cod. Cta. Haber:</B></TD>');
writeln('<TD><INPUT type="text" name="vto_h" VALUE="'+vto_h+'" OnChange="CtaNroPad(this)" SIZE='+client.pa_longcta+' ></TD></TR>');
request.f_clave=vto_clave;
}
if (request.f_traspaso !="gasto") {
writeln('<TR><TD ALIGN=LEFT><B>Clave:</B></TD>');
writeln('<TD><INPUT type="text" name="f_clave" VALUE="'+request.f_clave+'" OnChange="CtaNroPad(this)" SIZE='+client.pa_longcta+' ></TD></TR>');
}
writeln('</TABLE>');
writeln("<HR><CENTER>");
writeln('<INPUT TYPE="hidden" NAME="criterio" VALUE="'+request.criterio+'"></TD></TR>');
writeln('<INPUT TYPE="hidden" NAME="sel_order" VALUE="'+request.f_orden+'"></TD></TR>');
request.totalDocs=0;
request.sumaTotal=0;
// query = database.cursor("SELECT count(*),sum(importe_total) FROM facturas,proveedores WHERE facturas.nif=proveedores.nif "+
if (request.f_traspaso=="vto")
query = database.cursor("SELECT count(unique nro_reg_vto) FROM facturas,proveedores WHERE facturas.nif=proveedores.nif "+
" and "+request.criterio);
if (request.f_traspaso=="pago")
query = database.cursor("SELECT count(unique nro_doc_pago) FROM facturas,proveedores WHERE facturas.nif=proveedores.nif "+
" and "+request.criterio);
if (request.f_traspaso=="gasto")
query = database.cursor("SELECT count(unique nro_reg) FROM facturas,proveedores WHERE facturas.nif=proveedores.nif "+
" and "+request.criterio);
if (query.next()) {
request.totalDocs=query[0];
// request.sumaTotal=query[1];
}
query.close();
writeln('<HR>');
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
// writeln('<TD ALIGN=LEFT><B>Suma Total:</B><INPUT TYPE="text" NAME="sumaTotal" OnChange="" VALUE="'+NroFormat(request.sumaTotal,NF11)+'" SIZE=12 ></TD>');
writeln('<TD ALIGN=LEFT><B>Nro. Docs:</B><INPUT TYPE="text" NAME="totalDocs" VALUE="'+NroFormat(request.totalDocs,NF7)+'" OnChange="" SIZE=12 ></TD><TR>');
writeln('</TABLE>');
writeln('<HR>');
writeln('<CENTER><INPUT TYPE="submit" name="traspaso" value="Traspasar Documentos"></CENTER>');
}
if (request.doc_clean) {
cleanup_traspaso();
redirect(addClient("g_traspaso.html?"+baseHtml));
}
if (request.doc_traspaso) {
if (request.f_traspaso!="gasto")
status=database.execute("UPDATE facturas SET traspaso_"+request.f_traspaso+"='S', is_locked='S' WHERE "+request.criterio);
if (request.f_traspaso=="gasto")
status=database.execute("UPDATE facturas SET traspaso_"+request.f_traspaso+"='S', is_locked='N' WHERE "+request.criterio);
cleanup_traspaso();
redirect(addClient("g_traspaso.html?"+baseHtml));
}
if (request.traspaso || request.opt_traspaso) {
writeln('<CENTER><INPUT TYPE="submit" name="doc_traspaso" value="Confirmar">');
writeln('<INPUT TYPE="submit" name="doc_clean" value="Deshacer">');
writeln('<INPUT TYPE="submit" name="data_list" value="Fichero">');
writeln('<INPUT TYPE="submit" name="doc_list" value="Listar"></CENTER>');
writeln('<INPUT TYPE="hidden" NAME="opt_traspaso" VALUE="0">');
writeln('<INPUT TYPE="hidden" NAME="f_traspaso" VALUE="'+request.f_traspaso+'">');
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TR><TD ALIGN=LEFT><B>Fecha Emisión:</B></TD>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.f_emision+'</FONT><INPUT type="hidden" name="f_emision" VALUE="'+request.f_emision+'" size=8 maxlength=8></TD></FONT></TR>');
writeln('<TR><TD ALIGN=LEFT><B>Traspaso </B></TD>');
if (request.f_traspaso=="gasto")
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Gasto </B></FONT>');
if (request.f_traspaso=="pago")
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Pago </B></FONT>');
if (request.f_traspaso=="vto")
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B> Vencimiento </B></FONT>');
writeln('</TR>');
writeln('<TR><TD ALIGN=LEFT><B>Nro. Documento:</B>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.f_nro_doc+'</B></FONT><INPUT TYPE="hidden" NAME="f_nro_doc" VALUE="'+request.f_nro_doc+'">');
writeln('</TABLE>');
writeln('<INPUT TYPE="hidden" NAME="criterio" VALUE="'+request.criterio+'"></TD></TR>');
writeln('<INPUT TYPE="hidden" NAME="totalDocs" VALUE="'+request.totalDocs+'"></TD></TR>');
}
writeln('</FORM>');
if (!request.waux)
writeSignature(true);
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

600
g_vto.html Normal file
View File

@ -0,0 +1,600 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: g_vto.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>vtos</TITLE>
</HEAD>
<SERVER>
var NF9=""
var NF10=""
var HOY=new Date();
var linea="";
// Algunos formatos para fechas.
var NLDF=""; // para columnas en las queries INFORMIX
var baseHtml="";
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln(' <BODY');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln(' function chkYearNroReg(obj) {');
writeln(' var nro=parseInt(obj.value); ');
writeln(' if (nro+1 > 0 ) { ');
writeln(' obj.value=nro; ');
writeln(' if ( HOY.getFullYear() != nro ) ');
writeln(' alert("¡¡ El Año del Nro. de Registro no es el actual !! ");');
writeln(' }');
writeln(' }');
writeln('function NroPad(obj,longNro) {');
writeln(' if ( obj.value.length == 0 )');
writeln(' return;');
writeln(' if (obj.value.indexOf("*") >= 0) ');
writeln(' return;');
writeln(' c_nro=obj.value;');
writeln(' for (var j=c_nro.length ; j<longNro ; j++ ) {');
writeln(' c_nro="0"+c_nro;');
writeln(' }');
writeln(' obj.value=c_nro.substring(0,longNro);');
writeln('}');
if (request.gofunc) {
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_vto;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="o_vto.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
}
writeln('</SCRIPT>');
if(request.search1 || request.search2 || request.desde || request.hasta || request.f_orden) {
if (!request.gofunc) {
dbConnect();
// if(request.search1 || request.desde || request.hasta || request.multiple || request.f_orden) {
//Si se busca usando el texto de entrada
if (request.desde && request.hasta) {
var desde_fecha=DateFormat(request.desde,NLDF);
if ( desde_fecha.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
var hasta_fecha=DateFormat(request.hasta,NLDF);
if ( hasta_fecha.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
c_facturas = database.cursor("SELECT * FROM facturas,proveedores WHERE facturas.nif=proveedores.nif and "+ client.criteria +" Between '" +
desde_fecha + "' and '"+ hasta_fecha + "' ORDER BY " + client.criteria);
}
else if (request.search1) {
c_facturas = database.cursor("SELECT * FROM facturas,proveedores WHERE facturas.nif=proveedores.nif and "+ client.criteria +" MATCHES '" +
request.search1 + "' ORDER BY " + client.criteria);
}
else if (request.f_orden) {
var criterio=""
if ( request.f_desde.length > 0 ) {
var f_desde=DateFormat(request.f_desde,NLDF);
if ( f_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
criterio=" f_emision >= '"+f_desde+"' "
}
if ( request.f_hasta.length > 0 ) {
var f_hasta=DateFormat(request.f_hasta,NLDF);
if ( f_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" f_emision <= '"+f_hasta+"' "
}
if ( request.v_desde.length > 0 ) {
var v_desde=DateFormat(request.v_desde,NLDF);
if ( v_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago >= '"+v_desde+"' "
}
if ( request.v_hasta.length > 0 ) {
var v_hasta=DateFormat(request.v_hasta,NLDF);
if ( v_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago <= '"+v_hasta+"' "
}
if ( request.cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" cod_centro matches '"+request.cod_centro+"'"
}
if ( request.nif.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nif matches '"+request.nif+"'"
}
if ( request.nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_fra matches '"+request.nro_fra+"'"
}
if ( request.nro_regn.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_reg matches '"+StringClip(true,request.nro_regy)+StringClip(true,request.nro_regn)+"'"
}
if ( request.h_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.mes >= '"+request.d_mes_fra+"' and facturas.mes <= '"+request.h_mes_fra+"'"
} else {
if ( request.d_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.mes matches '"+request.d_mes_fra+"'"
}
}
if ( request.h_nro_doc_pago.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_doc_pago >= '"+request.d_nro_doc_pago+"' and facturas.nro_doc_pago <= '"+request.h_nro_doc_pago+"'"
} else {
if ( request.d_nro_doc_pago.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_doc_pago matches '"+request.d_nro_doc_pago+"'"
}
}
if ( request.h_nro_reg_vton.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_reg_vto >= '"+StringClip(true,request.d_nro_reg_vtoy)+StringClip(true,request.d_nro_reg_vton)+"' and facturas.nro_reg_vto <= '"+StringClip(true,request.h_nro_reg_vtoy)+StringClip(true,request.h_nro_reg_vton)+"'"
} else {
if ( request.d_nro_reg_vton.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_reg_vto matches '"+StringClip(true,request.d_nro_reg_vtoy)+StringClip(true,request.d_nro_reg_vton)+"'"
}
}
if ( request.razon_social.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
var razon_social=request.razon_social;
// var lowcaps = request.razon_social.toLowerCase();
// var uppercaps = request.razon_social.toUpperCase();
criterio=criterio+"razon_social matches '"+razon_social+"'"
}
c_facturas = database.cursor("SELECT * FROM facturas,proveedores WHERE facturas.nif=proveedores.nif and "+ criterio +
" ORDER BY " + request.f_orden);
}
if (!c_facturas)
DbsError(false,-1);
client.search1 = request.search1;
}
if(request.search2) {
if(request.search2 == "all") {
//Selecciono todos los facturas, sin criterio
c_facturas = database.cursor("SELECT * FROM facturas,proveedores where facturas.nif=proveedores.nif ORDER BY nro_reg ");
if (!c_facturas)
DbsError(false,-1);
}
else {
//Selecciona todas las filas en las que el descripcion empieza con la letra elejida.
var lowcaps = request.search2.toLowerCase();
c_facturas = database.cursor("SELECT * FROM facturas f,proveedores "+
" WHERE facturas.nif=proveedores.nif and "
+ client.criteria + " MATCHES '" + request.search2 + "*' OR " +
client.criteria +" MATCHES '" + lowcaps + "*'"+
" ORDER BY " + client.criteria);
if (!c_facturas)
DbsError(false,-1);
}
client.search2 = request.search2;
}
// }
}
else {
if (!request.nro_reg && !request.f_emision && !request.nif && !request.cod_centro ) {
request.multiple ="Múltiple";
}
}
if (request.fecha_emision) {
client.criteria="f_emision";
client.des_criteria="cuya fecha de emisión";
}
if (request.vto_pago) {
client.criteria="vto_pago";
client.des_criteria="cuyo vto. de pago";
}
if (request.multiple ) {
client.criteria="multiple";
client.des_criteria="según criterio de búsqueda ";
}
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RangoFecha(obj,clave) {');
writeln(' if (obj.value.length > 0 ){ ');
writeln(' if (clave == "emision") { ');
writeln(' if (dateCmp(obj.value,document.g_factura.f_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_factura.f_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "vto") { ');
writeln(' if (dateCmp(obj.value,document.g_factura.v_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_factura.v_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "fecha") { ');
writeln(' if (dateCmp(obj.value,document.g_factura.desde.value) != 1 ) {');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_factura.desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' } ');
writeln('} ');
writeln('function HastaDefault(obj,clave) {');
writeln(' if (obj.value.length <= 0 ){ ');
writeln(' if (clave == "emision") ');
writeln(' obj.value=document.g_factura.f_desde.value;');
writeln(' if (clave == "vto") ');
writeln(' obj.value=document.g_factura.v_desde.value;');
writeln(' if (clave == "fecha") ');
writeln(' obj.value=document.g_factura.desde.value;');
writeln(' } ');
writeln('} ');
writeln('</SCRIPT>');
criterio="criterio múltiple";
if ( client.criteria == "multiple")
criterio="criterio múltiple";
if ( client.criteria == "f_emision" )
criterio="por fecha emision";
if ( client.criteria == "vto_pago" )
criterio="por vto. de pago";
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Facturas",criterio,"fa_");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="o_vto.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("Vencimientos",criterio,"fa_")
writeln('</FORM>');
}
writeln('<FORM NAME="g_vto" method="Post" action="g_vto.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM NAME="g_vto" method="Post" action="g_vto.html?waux='+request.waux+'&'+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
writeln("<B>Cambiar Seleccion Datos por: </B>");
//if ( client.criteria != "fecha_emision" )
// writeln("<INPUT TYPE='submit' NAME='fecha_emision' value='F.Emisión'>");
//if ( client.criteria != "vto_pago" )
// writeln("<INPUT TYPE='submit' NAME='vto_pago' value='Vto.Pago'>");
if ( client.criteria != "multiple" )
writeln("<INPUT TYPE='submit' NAME='multiple' value='Múltiple'>");
writeln("<HR>");
if (client.criteria == "f_emision" || client.criteria == "vto_pago" || client.criteria == "multiple" ) {
if (client.criteria == "multiple" ) {
if (!request.nif)
request.nif="";
if (!request.cod_centro)
request.cod_centro="";
if (!request.razon_social)
request.razon_social="";
if (!request.nro_fra)
request.nro_fra="";
if (!request.f_desde)
request.f_desde="";
if (!request.f_hasta)
request.f_hasta="";
if (!request.v_desde)
request.v_desde="";
if (!request.v_hasta)
request.v_hasta="";
if (!request.nro_regn)
request.nro_regn="";
if (!request.d_mes_fra)
request.d_mes_fra="";
if (!request.h_mes_fra)
request.h_mes_fra="";
if (!request.d_nro_reg_vton)
request.d_nro_reg_vton="";
if (!request.d_nro_reg_vtoy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.d_nro_reg_vtoy=n;
}
if (!request.h_nro_reg_vton)
request.h_nro_reg_vton="";
if (!request.h_nro_reg_vtoy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.h_nro_reg_vtoy=n;
}
if (!request.d_nro_doc_pago)
request.d_nro_doc_pago="";
if (!request.h_nro_doc_pago)
request.h_nro_doc_pago="";
if (!request.nro_regy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.nro_regy=n;
}
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Apte Vto.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_reg_vton" VALUE="'+request.d_nro_reg_vton+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="d_nro_reg_vtoy" VALUE="'+request.d_nro_reg_vtoy+'" SIZE=4 OnChange="chkYearNroReg(this)">');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_reg_vton" VALUE="'+request.h_nro_reg_vton+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="h_nro_reg_vtoy" VALUE="'+request.h_nro_reg_vtoy+'" SIZE=4 OnChange="chkYearNroReg(this)"><INPUT TYPE="submit" value=" / "></TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Reg.: </B></TD><TD><INPUT TYPE="text" NAME="nro_regn" VALUE="'+request.nro_regn+'" OnChange="NroPad(this,5)" SIZE=5 ><INPUT TYPE="submit" value=" / "><INPUT TYPE="text" NAME="nro_regy" VALUE="'+request.nro_regy+'" SIZE=4 OnChange="chkYearNroReg(this)"></TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Fra.: </B></TD><TD><INPUT TYPE="text" NAME="nro_fra" VALUE="'+request.nro_fra+'" SIZE=12 > </TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Mes.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_mes_fra" VALUE="'+request.d_mes_fra+'" SIZE=2 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_mes_fra" VALUE="'+request.h_mes_fra+'" SIZE=2 > </TD>');
writeln("<TR><TD ALIGN=LEFT>N.I.F. .......: </TD><TD><INPUT type='text' name='nif' size=12 maxlength=12 VALUE='"+request.nif +"' onChange='this.value=this.value.toUpperCase()' > </TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Razón Social .: </TD><TD><INPUT type='text' name='razon_social' size=30 maxlength=40 VALUE='"+request.razon_social +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Código Centro : </TD><TD><INPUT type='text' name='cod_centro' size=12 maxlength=12 VALUE='"+request.cod_centro +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Emitida Desde: </TD><TD><INPUT type='text' name='f_desde' size=8 maxlength=10 VALUE='"+request.f_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='f_hasta' size=8 maxlength=10 VALUE='"+request.f_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"emision\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"emision\")' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Vto. Pago Desde: </TD><TD><INPUT type='text' name='v_desde' size=8 maxlength=10 VALUE='"+request.v_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='v_hasta' size=8 maxlength=10 VALUE='"+request.v_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"vto\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"vto\")''></TD></TR>");
writeln('<TR><TD ALIGN=LEFT><B>Nro.Doc.Pago: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_doc_pago" VALUE="'+request.d_nro_doc_pago+'" SIZE=12 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_doc_pago" VALUE="'+request.h_nro_doc_pago+'" SIZE=12 > </TD>');
writeln('<TR><TD ALIGN=LEFT>Ordenado por: </TD><TD><SELECT NAME="f_orden" SIZE=1>');
writeln('<OPTION VALUE="razon_social" >Razón Social');
writeln('<OPTION VALUE="nif" >N.I.F.');
writeln('<OPTION VALUE="nro_fra" >Nro.Fra. ');
writeln('<OPTION VALUE="nro_reg" SELECTED>Nro.Reg. ');
writeln('<OPTION VALUE="nro_reg_vto">Apte. Vto. ');
writeln('<OPTION VALUE="f_emision" >Fecha Emisión');
writeln('<OPTION VALUE="vto_pago" >Vto. Pago');
writeln('<OPTION VALUE="cod_centro" >Centro ');
writeln('<OPTION VALUE="f_emision" >Fecha Pago ');
writeln('<OPTION VALUE="vto_pago" >Vto. Pago ');
writeln('</SELECT></TD></TR></SELECT></TABLE>');
}
else {
if (!request.desde)
request.desde="";
if (!request.hasta)
request.hasta="";
writeln("Desde: <INPUT type='text' name='desde' size=8 maxlength=10 VALUE='"+request.desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='hasta' size=8 maxlength=10 VALUE='"+request.hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"fecha\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"fecha\")' >");
}
}
else {
if(request.search1 == null)
writeln("<INPUT type='text' name='search1'>");
else
writeln("<INPUT type='text' name='search1' VALUE='" + request.search1 + "'>");
}
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('</FORM>');
if ( client.criteria == "multiple" )
writeln("<b>Según criterio </b>");
if ( client.criteria == "f_emision" )
writeln("<b>Fecha de Emisión entre:</b>");
if ( client.criteria == "vto_pago" )
writeln("<b>Fecha de Vto. Pago entre:</b>");
if ( client.criteria == "nro_reg" )
writeln("Número de Registro empieza por:<BR>")
writeln("<CENTER>");
if (!request.waux) {
refHtml="g_vto.html?"+baseHtml+"&search2=";
}
else {
refHtml="g_vto.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
if ( client.criteria != "f_emision" && client.criteria != "vto_pago" && client.criteria != "multiple" )
buttonsLetrasNros(refHtml,false);
writeln("</CENTER><HR>");
if (request.search1) {
if ( client.criteria == "f_emision" || client.criteria == "vto_pago" )
writeln("facturas "+ client.des_criteria +" entre <FONT SIZE=+2>" + request.desde + " - "+ request.hasta +" </FONT><BR>")
else
writeln("facturas "+ client.des_criteria +" contiene <FONT SIZE=+2>" + request.search1 + "</FONT><BR>")
}
if (request.search2) {
if(request.search2 == "all") {
writeln("Lista de todos los facturas<BR>");
}
else {
writeln("facturas " + client.des_criteria + " empieza por <FONT SIZE=+2>" + request.search2 + "</FONT><BR>");
}
}
writeln("<HR>");
if(request.search1 || request.search2 || request.desde || request.hasta || request.f_orden ) {
writeln('<TABLE ALIGN="CENTER" BORDER=1>');
var suma_total=0;
var nrows=0;
while (c_facturas.next()) {
nrows++;
LastRow=c_facturas.nro_reg;
//lista de todos los facturas devueltos por el cursor.
if ( client.criteria == "f_emision" ){
if (!request.waux)
writeln("<TR><TD ALIGN=RIGTH><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_vto.html"+
"?fa_nro_reg=" + escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
datetoString(c_facturas.f_emision) + "</TD><TD>" +
c_facturas.nro_reg_vto.substring(4,c_facturas.nro_reg_vto.length) + "/" +
c_facturas.nro_reg_vto.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_vto.html?waux="+request.waux+
"&fa_nro_reg="+ escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg_vto.substring(4,c_facturas.nro_reg_vto.length) + "/" +
c_facturas.nro_reg_vto.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A><BR></TD></TR>");
}
if ( client.criteria == "vto_pago" ){
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_vto.html"+
"?fa_nro_reg=" + escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg_vto.substring(4,c_facturas.nro_reg_vto.length) + "/" +
c_facturas.nro_reg_vto.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_vto.html?waux="+request.waux+
"&fa_nro_reg="+ escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg_vto.substring(4,c_facturas.nro_reg_vto.length) + "/" +
c_facturas.nro_reg_vto.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A><BR></TD></TR>");
}
if ( client.criteria == "nro_reg" ){
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_vto.html"+
"?fa_nro_reg=" + escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg_vto.substring(4,c_facturas.nro_reg_vto.length) + "/" +
c_facturas.nro_reg_vto.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_vto.html?waux="+request.waux+
"&fa_nro_reg="+ escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg_vto.substring(4,c_facturas.nro_reg_vto.length) + "/" +
c_facturas.nro_reg_vto.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A><BR></TD></TR>");
}
if ( client.criteria == "multiple") {
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_vto.html"+
"?fa_nro_reg=" + escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
StringClip(true,c_facturas.nro_fra) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg_vto.substring(4,c_facturas.nro_reg_vto.length) + "/" +
c_facturas.nro_reg_vto.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision_pago) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
StringClip(true,c_facturas.cod_centro) + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif +
"</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_vto.html?waux="+request.waux+
"&fa_nro_reg="+ escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
StringClip(true,c_facturas.nro_fra) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg_vto.substring(4,c_facturas.nro_reg_vto.length) + "/" +
c_facturas.nro_reg_vto.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision_pago) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
StringClip(true,c_facturas.cod_centro) + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif +
"</A><BR></TD></TR>");
}
suma_total=suma_total+c_facturas.importe_total;
}
c_facturas.close();
writeln("<TR><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD ALIGN=RIGHT></TD><TD ALIGN=RIGHT>----------------</TD>");
writeln("<TR><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD ALIGN=RIGHT>Suma Total:</TD><TD ALIGN=RIGHT>"+NroFormat(suma_total,NF10) +"</TD>");
writeln("</TABLE>");
if ( nrows == 1 )
redirect("o_vto.html?fa_nro_reg=" + escape(StringClip(false,LastRow))+"&"+baseHtml)
}
if (!request.waux)
writeSignature(true);
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

566
g_vtos.html Normal file
View File

@ -0,0 +1,566 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: g_vtos.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>vtos</TITLE>
</HEAD>
<SERVER>
var NF9=""
var NF10=""
var HOY=new Date();
var linea="";
// Algunos formatos para fechas.
var NLDF=""; // para columnas en las queries INFORMIX
var baseHtml="";
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln(' <BODY');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln(' function chkYearNroReg(obj) {');
writeln(' var nro=parseInt(obj.value); ');
writeln(' if (nro+1 > 0 ) { ');
writeln(' obj.value=nro; ');
writeln(' if ( HOY.getFullYear() != nro ) ');
writeln(' alert("¡¡ El Año del Nro. de Registro no es el actual !! ");');
writeln(' }');
writeln(' }');
writeln('function NroPad(obj,longNro) {');
writeln(' if ( obj.value.length == 0 )');
writeln(' return;');
writeln(' if (obj.value.indexOf("*") >= 0) ');
writeln(' return;');
writeln(' c_nro=obj.value;');
writeln(' for (var j=c_nro.length ; j<longNro ; j++ ) {');
writeln(' c_nro="0"+c_nro;');
writeln(' }');
writeln(' obj.value=c_nro.substring(0,longNro);');
writeln('}');
if (request.gofunc) {
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_vtos;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="o_vtos.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
}
writeln('</SCRIPT>');
if(request.search1 || request.search2 || request.desde || request.hasta || request.f_orden) {
if (!request.gofunc) {
dbConnect();
// if(request.search1 || request.desde || request.hasta || request.multiple || request.f_orden) {
//Si se busca usando el texto de entrada
if (request.desde && request.hasta) {
var desde_fecha=DateFormat(request.desde,NLDF);
if ( desde_fecha.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
var hasta_fecha=DateFormat(request.hasta,NLDF);
if ( hasta_fecha.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
c_facturas = database.cursor("SELECT * FROM facturas,proveedores WHERE facturas.nif=proveedores.nif and "+ client.criteria +" Between '" +
desde_fecha + "' and '"+ hasta_fecha + "' ORDER BY " + client.criteria);
}
else if (request.search1) {
c_facturas = database.cursor("SELECT * FROM facturas,proveedores WHERE facturas.nif=proveedores.nif and "+ client.criteria +" MATCHES '" +
request.search1 + "' ORDER BY " + client.criteria);
}
else if (request.f_orden) {
var criterio=""
if ( request.f_desde.length > 0 ) {
var f_desde=DateFormat(request.f_desde,NLDF);
if ( f_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
criterio=" f_emision >= '"+f_desde+"' "
}
if ( request.f_hasta.length > 0 ) {
var f_hasta=DateFormat(request.f_hasta,NLDF);
if ( f_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" f_emision <= '"+f_hasta+"' "
}
if ( request.v_desde.length > 0 ) {
var v_desde=DateFormat(request.v_desde,NLDF);
if ( v_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago >= '"+v_desde+"' "
}
if ( request.v_hasta.length > 0 ) {
var v_hasta=DateFormat(request.v_hasta,NLDF);
if ( v_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago <= '"+v_hasta+"' "
}
if ( request.cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" cod_centro matches '"+request.cod_centro+"'"
}
if ( request.nif.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nif matches '"+request.nif+"'"
}
if ( request.nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_fra matches '"+request.nro_fra+"'"
}
if ( request.nro_regn.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_reg matches '"+StringClip(true,request.nro_regy)+StringClip(true,request.nro_regn)+"'"
}
if ( request.h_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.mes >= '"+request.d_mes_fra+"' and facturas.mes <= '"+request.h_mes_fra+"'"
} else {
if ( request.d_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.mes matches '"+request.d_mes_fra+"'"
}
}
if ( request.h_nro_doc_pago.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_doc_pago >= '"+request.d_nro_doc_pago+"' and facturas.nro_doc_pago <= '"+request.h_nro_doc_pago+"'"
} else {
if ( request.d_nro_doc_pago.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_doc_pago matches '"+request.d_nro_doc_pago+"'"
}
}
if ( request.razon_social.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
var razon_social=request.razon_social;
// var lowcaps = request.razon_social.toLowerCase();
// var uppercaps = request.razon_social.toUpperCase();
criterio=criterio+"razon_social matches '"+razon_social+"'"
}
c_facturas = database.cursor("SELECT * FROM facturas,proveedores WHERE facturas.nif=proveedores.nif and "+ criterio +
" ORDER BY " + request.f_orden);
}
if (!c_facturas)
DbsError(false,-1);
client.search1 = request.search1;
}
if(request.search2) {
if(request.search2 == "all") {
//Selecciono todos los facturas, sin criterio
c_facturas = database.cursor("SELECT * FROM facturas,proveedores where facturas.nif=proveedores.nif ORDER BY nro_reg ");
if (!c_facturas)
DbsError(false,-1);
}
else {
//Selecciona todas las filas en las que el descripcion empieza con la letra elejida.
var lowcaps = request.search2.toLowerCase();
c_facturas = database.cursor("SELECT * FROM facturas f,proveedores "+
" WHERE facturas.nif=proveedores.nif and "
+ client.criteria + " MATCHES '" + request.search2 + "*' OR " +
client.criteria +" MATCHES '" + lowcaps + "*'"+
" ORDER BY " + client.criteria);
if (!c_facturas)
DbsError(false,-1);
}
client.search2 = request.search2;
}
// }
}
else {
if (!request.nro_reg && !request.f_emision && !request.nif && !request.cod_centro ) {
request.multiple ="Múltiple";
}
}
if (request.fecha_emision) {
client.criteria="f_emision";
client.des_criteria="cuya fecha de emisión";
}
if (request.vto_pago) {
client.criteria="vto_pago";
client.des_criteria="cuyo vto. de pago";
}
if (request.multiple ) {
client.criteria="multiple";
client.des_criteria="según criterio de búsqueda ";
}
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RangoFecha(obj,clave) {');
writeln(' if (obj.value.length > 0 ){ ');
writeln(' if (clave == "emision") { ');
writeln(' if (dateCmp(obj.value,document.g_factura.f_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_factura.f_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "vto") { ');
writeln(' if (dateCmp(obj.value,document.g_factura.v_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_factura.v_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "fecha") { ');
writeln(' if (dateCmp(obj.value,document.g_factura.desde.value) != 1 ) {');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_factura.desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' } ');
writeln('} ');
writeln('function HastaDefault(obj,clave) {');
writeln(' if (obj.value.length <= 0 ){ ');
writeln(' if (clave == "emision") ');
writeln(' obj.value=document.g_factura.f_desde.value;');
writeln(' if (clave == "vto") ');
writeln(' obj.value=document.g_factura.v_desde.value;');
writeln(' if (clave == "fecha") ');
writeln(' obj.value=document.g_factura.desde.value;');
writeln(' } ');
writeln('} ');
writeln('</SCRIPT>');
criterio="criterio múltiple";
if ( client.criteria == "multiple")
criterio="criterio múltiple";
if ( client.criteria == "f_emision" )
criterio="por fecha emision";
if ( client.criteria == "vto_pago" )
criterio="por vto. de pago";
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Facturas",criterio,"fa_");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="o_vtos.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("Vencimientos",criterio,"fa_")
writeln('</FORM>');
}
writeln('<FORM NAME="g_vtos" method="Post" action="g_vtos.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM NAME="g_vtos" method="Post" action="g_vtos.html?waux='+request.waux+'&'+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
writeln("<B>Cambiar Seleccion Datos por: </B>");
if ( client.criteria != "fecha_emision" )
writeln("<INPUT TYPE='submit' NAME='fecha_emision' value='F.Emisión'>");
if ( client.criteria != "vto_pago" )
writeln("<INPUT TYPE='submit' NAME='vto_pago' value='Vto.Pago'>");
if ( client.criteria != "multiple" )
writeln("<INPUT TYPE='submit' NAME='multiple' value='Múltiple'>");
writeln("<HR>");
if (client.criteria == "f_emision" || client.criteria == "vto_pago" || client.criteria == "multiple" ) {
if (client.criteria == "multiple" ) {
if (!request.nif)
request.nif="";
if (!request.cod_centro)
request.cod_centro="";
if (!request.razon_social)
request.razon_social="";
if (!request.nro_fra)
request.nro_fra="";
if (!request.f_desde)
request.f_desde="";
if (!request.f_hasta)
request.f_hasta="";
if (!request.v_desde)
request.v_desde="";
if (!request.v_hasta)
request.v_hasta="";
if (!request.nro_regn)
request.nro_regn="";
if (!request.d_mes_fra)
request.d_mes_fra="";
if (!request.h_mes_fra)
request.h_mes_fra="";
if (!request.d_nro_doc_pago)
request.d_nro_doc_pago="";
if (!request.h_nro_doc_pago)
request.h_nro_doc_pago="";
if (!request.nro_regy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.nro_regy=n;
}
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Reg.: </B></TD><TD><INPUT TYPE="text" NAME="nro_regn" VALUE="'+request.nro_regn+'" OnChange="NroPad(this,5)" SIZE=5 ><INPUT TYPE="submit" value=" / "><INPUT TYPE="text" NAME="nro_regy" VALUE="'+request.nro_regy+'" SIZE=4 OnChange="chkYearNroReg(this)"></TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Fra.: </B></TD><TD><INPUT TYPE="text" NAME="nro_fra" VALUE="'+request.nro_fra+'" SIZE=12 > </TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Mes.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_mes_fra" VALUE="'+request.d_mes_fra+'" SIZE=2 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_mes_fra" VALUE="'+request.h_mes_fra+'" SIZE=2 > </TD>');
writeln("<TR><TD ALIGN=LEFT>N.I.F. .......: </TD><TD><INPUT type='text' name='nif' size=12 maxlength=12 VALUE='"+request.nif +"' onChange='this.value=this.value.toUpperCase()' > </TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Razón Social .: </TD><TD><INPUT type='text' name='razon_social' size=30 maxlength=40 VALUE='"+request.razon_social +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Código Centro : </TD><TD><INPUT type='text' name='cod_centro' size=12 maxlength=12 VALUE='"+request.cod_centro +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Emitida Desde: </TD><TD><INPUT type='text' name='f_desde' size=8 maxlength=10 VALUE='"+request.f_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='f_hasta' size=8 maxlength=10 VALUE='"+request.f_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"emision\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"emision\")' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Vto. Pago Desde: </TD><TD><INPUT type='text' name='v_desde' size=8 maxlength=10 VALUE='"+request.v_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='v_hasta' size=8 maxlength=10 VALUE='"+request.v_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"vto\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"vto\")''></TD></TR>");
writeln('<TR><TD ALIGN=LEFT><B>Nro.Doc.Pago: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_doc_pago" VALUE="'+request.d_nro_doc_pago+'" SIZE=12 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_doc_pago" VALUE="'+request.h_nro_doc_pago+'" SIZE=12 > </TD>');
writeln('<TR><TD ALIGN=LEFT>Ordenado por: </TD><TD><SELECT NAME="f_orden" SIZE=1>');
writeln('<OPTION VALUE="razon_social" >Razón Social');
writeln('<OPTION VALUE="nif" >N.I.F.');
writeln('<OPTION VALUE="nro_fra" >Nro.Fra. ');
writeln('<OPTION VALUE="nro_reg" SELECTED>Nro.Reg. ');
writeln('<OPTION VALUE="f_emision" >Fecha Emisión');
writeln('<OPTION VALUE="vto_pago" >Vto. Pago');
writeln('<OPTION VALUE="cod_centro" >Centro ');
writeln('<OPTION VALUE="f_emision" >Fecha Pago ');
writeln('<OPTION VALUE="vto_pago" >Vto. Pago ');
writeln('</SELECT></TD></TR></SELECT></TABLE>');
}
else {
if (!request.desde)
request.desde="";
if (!request.hasta)
request.hasta="";
writeln("Desde: <INPUT type='text' name='desde' size=8 maxlength=10 VALUE='"+request.desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='hasta' size=8 maxlength=10 VALUE='"+request.hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"fecha\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"fecha\")' >");
}
}
else {
if(request.search1 == null)
writeln("<INPUT type='text' name='search1'>");
else
writeln("<INPUT type='text' name='search1' VALUE='" + request.search1 + "'>");
}
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('</FORM>');
if ( client.criteria == "multiple" )
writeln("<b>Según criterio </b>");
if ( client.criteria == "f_emision" )
writeln("<b>Fecha de Emisión entre:</b>");
if ( client.criteria == "vto_pago" )
writeln("<b>Fecha de Vto. Pago entre:</b>");
if ( client.criteria == "nro_reg" )
writeln("Número de Registro empieza por:<BR>")
writeln("<CENTER>");
if (!request.waux) {
refHtml="g_vtos.html?"+baseHtml+"&search2=";
}
else {
refHtml="g_vtos.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
if ( client.criteria != "f_emision" && client.criteria != "vto_pago" && client.criteria != "multiple" )
buttonsLetrasNros(refHtml,false);
writeln("</CENTER><HR>");
if (request.search1) {
if ( client.criteria == "f_emision" || client.criteria == "vto_pago" )
writeln("facturas "+ client.des_criteria +" entre <FONT SIZE=+2>" + request.desde + " - "+ request.hasta +" </FONT><BR>")
else
writeln("facturas "+ client.des_criteria +" contiene <FONT SIZE=+2>" + request.search1 + "</FONT><BR>")
}
if (request.search2) {
if(request.search2 == "all") {
writeln("Lista de todos los facturas<BR>");
}
else {
writeln("facturas " + client.des_criteria + " empieza por <FONT SIZE=+2>" + request.search2 + "</FONT><BR>");
}
}
writeln("<HR>");
if(request.search1 || request.search2 || request.desde || request.hasta || request.f_orden ) {
writeln('<TABLE ALIGN="CENTER" BORDER=1>');
var suma_total=0;
var nrows=0;
while (c_facturas.next()) {
nrows++;
LastRow=c_facturas.nro_reg;
//lista de todos los facturas devueltos por el cursor.
if ( client.criteria == "f_emision" ){
if (!request.waux)
writeln("<TR><TD ALIGN=RIGTH><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_vtos.html"+
"?fa_nro_reg=" + escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
datetoString(c_facturas.f_emision) + "</TD><TD>" +
c_facturas.nro_reg_vto.substring(4,c_facturas.nro_reg_vto.length) + "/" +
c_facturas.nro_reg_vto.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_vtos.html?waux="+request.waux+
"&fa_nro_reg="+ escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg_vto.substring(4,c_facturas.nro_reg_vto.length) + "/" +
c_facturas.nro_reg_vto.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A><BR></TD></TR>");
}
if ( client.criteria == "vto_pago" ){
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_vtos.html"+
"?fa_nro_reg=" + escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg_vto.substring(4,c_facturas.nro_reg_vto.length) + "/" +
c_facturas.nro_reg_vto.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_vtos.html?waux="+request.waux+
"&fa_nro_reg="+ escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg_vto.substring(4,c_facturas.nro_reg_vto.length) + "/" +
c_facturas.nro_reg_vto.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A><BR></TD></TR>");
}
if ( client.criteria == "nro_reg" ){
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_vtos.html"+
"?fa_nro_reg=" + escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg_vto.substring(4,c_facturas.nro_reg_vto.length) + "/" +
c_facturas.nro_reg_vto.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_vtos.html?waux="+request.waux+
"&fa_nro_reg="+ escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg_vto.substring(4,c_facturas.nro_reg_vto.length) + "/" +
c_facturas.nro_reg_vto.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.cod_centro + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) +
"</A><BR></TD></TR>");
}
if ( client.criteria == "multiple") {
if (!request.waux)
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_vtos.html"+
"?fa_nro_reg=" + escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
StringClip(true,c_facturas.nro_fra) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg_vto.substring(4,c_facturas.nro_reg_vto.length) + "/" +
c_facturas.nro_reg_vto.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision_pago) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
StringClip(true,c_facturas.cod_centro) + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif +
"</A></TD></TR>");
else
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_vtos.html?waux="+request.waux+
"&fa_nro_reg="+ escape(StringClip(false,c_facturas.nro_reg))+"&"+baseHtml + "'>" +
StringClip(true,c_facturas.nro_fra) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.razon_social+ "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nro_reg_vto.substring(4,c_facturas.nro_reg_vto.length) + "/" +
c_facturas.nro_reg_vto.substring(0,4) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.f_emision_pago) + "</TD><TD ALIGN=RIGHT>" +
datetoString(c_facturas.vto_pago) + "</TD><TD ALIGN=RIGHT>" +
StringClip(true,c_facturas.cod_centro) + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF9) + "</TD><TD ALIGN=RIGHT>" +
c_facturas.nif +
"</A><BR></TD></TR>");
}
suma_total=suma_total+c_facturas.importe_total;
}
c_facturas.close();
writeln("<TR><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD ALIGN=RIGHT></TD><TD ALIGN=RIGHT>----------------</TD>");
writeln("<TR><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD ALIGN=RIGHT>Suma Total:</TD><TD ALIGN=RIGHT>"+NroFormat(suma_total,NF10) +"</TD>");
writeln("</TABLE>");
if ( nrows == 1 )
redirect("o_vtos.html?fa_nro_reg=" + escape(StringClip(false,LastRow))+"&"+baseHtml)
}
if (!request.waux)
writeSignature(true);
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

1448
global.js Normal file

File diff suppressed because it is too large Load Diff

26
go_close.html Normal file
View File

@ -0,0 +1,26 @@
<HTML>
<HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SERVER>
//<!--
writeln('<SCRIPT LANGUAGE="JavaScript">');
writeln('function Go_Location() {');
writeln(' winInfo="¡¡ No hay Conexión con la Base de Datos !! \\r";');
writeln(' winInfo += "Es necesario iniciar una nueva sesión. \\r";');
writeln(' winInfo += "La ventana se cerrará ahora.";');
writeln(' alert(winInfo);');
writeln(' top.close() ');
writeln('}');
writeln('</SCRIPT>');
//-->
</SERVER>
</HEAD>
<BODY ONLOAD="Go_Location()")
</BODY>
</HTML>

26
go_frame.html Normal file
View File

@ -0,0 +1,26 @@
<HTML>
<HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SERVER>
//<!--
//function Go_Location(){
writeln("<SCRIPT LANGUAGE='JavaScript'>")
writeln("function Go_Location() {")
// writeln(' top.location.target="_parent"')
// parent.frames[0].location.href=\'content.html\'; history.go(0)">')
// writeln(' parent.frames[1].location.href=entorno.DirBase+"/'+request.page+'"')
writeln(' top.frames['+request.frameNro+'].location.href=entorno.DirBase+"/'+request.page+'"')
writeln("}")
writeln("</SCRIPT>")
//}
//-->
</SERVER>
</HEAD>
<BODY ONLOAD="Go_Location()" >
</BODY>
</HTML>

20
go_page.html Normal file
View File

@ -0,0 +1,20 @@
<HTML>
<HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SERVER>
//<!--
//function Go_Location(){
writeln("<SCRIPT LANGUAGE='JavaScript'>")
writeln("function Go_Location() {")
writeln(' top.location.href=entorno.DirBase+"/'+request.page+'"')
writeln("}")
writeln("</SCRIPT>")
//}
//-->
</SERVER>
</HEAD>
<BODY ONLOAD="Go_Location()" >
</BODY>
</HTML>

20
help.html Normal file
View File

@ -0,0 +1,20 @@
<html>
<!-- application: Cuentas a Pagar -->
<!-- version: 1.0 -->
<!-- company name: AdmiSys -->
<!-- filename: help.html -->
<!-- description: frameset for online help facility -->
<head>
<title>Ayuda en Línea</title>
</head>
<script language="JavaScript">
topic = location.hash
document.write("<frameset rows='52,*'>")
document.write("<frame src='help_navbar.html' scrolling=no marginwidth=0 marginheight=0 name='buttons'>")
document.write("<frame src= helptopics.html" + topic + " name='topic'>")
</script>
</frameset>
</html>

74
help_contents.html Normal file
View File

@ -0,0 +1,74 @@
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="Adobe PageMill 2.0 Win">
</HEAD>
<BODY BACKGROUND="images/backgrnd.gif">
<P><body bgcolor="#ffffff" link="#003366" vlink="#333399"><IMG SRC="images/help.gif"
ALT="Help" WIDTH="122" HEIGHT="59" NATURALSIZEFLAG="0" ALIGN="BOTTOM"> <BASE TARGET="topic"></P>
<H2>Indice de Contenidos:</H2>
<P>&nbsp;</P>
<H3>Introducci&oacute;n:</H3>
<UL>
<P><h3><FONT SIZE=+1>Que es </FONT></h3><h3><FONT SIZE=+1>Que hace</FONT></h3>
</UL>
<H3>Tecnolog&iacute;a y Plataforma.</H3>
<H3>Esquema y estructura de datos. Como usar esta Aplicaci&oacute;n:</H3>
<H3>&nbsp;</H3>
<H3><IMG SRC="images/ball_gre.gif" WIDTH="14" HEIGHT="14" ALIGN="BOTTOM"
NATURALSIZEFLAG="3">Como usar cursor, rat&oacute;n y navegador.</H3>
<UL>
<P><IMG SRC="images/ball_gre.gif" WIDTH="14" HEIGHT="14" ALIGN="BOTTOM"
NATURALSIZEFLAG="3"><B><FONT SIZE=+1>Pantalla de Entrada.</FONT></B>
<P><IMG SRC="images/ball_gre.gif" WIDTH="14" HEIGHT="14" ALIGN="BOTTOM"
NATURALSIZEFLAG="3"><B><FONT SIZE=+1>Men&uacute; Principal.</FONT></B>
<P><B><IMG SRC="images/ball_gre.gif" WIDTH="14" HEIGHT="14" ALIGN="BOTTOM"
NATURALSIZEFLAG="3"><FONT SIZE=+1>Facturas.</FONT></B>
<P><B><IMG SRC="images/ball_gre.gif" WIDTH="14" HEIGHT="14" ALIGN="BOTTOM"
NATURALSIZEFLAG="3"><FONT SIZE=+1>Albaranes.</FONT></B>
<P><B><IMG SRC="images/ball_gre.gif" WIDTH="14" HEIGHT="14" ALIGN="BOTTOM"
NATURALSIZEFLAG="3"><FONT SIZE=+1>Proveedores.</FONT></B>
<P><B><IMG SRC="images/ball_gre.gif" WIDTH="14" HEIGHT="14" ALIGN="BOTTOM"
NATURALSIZEFLAG="3"><FONT SIZE=+1>Pedidos.</FONT></B>
<P><B><IMG SRC="images/ball_gre.gif" WIDTH="14" HEIGHT="14" ALIGN="BOTTOM"
NATURALSIZEFLAG="3"><FONT SIZE=+1>Centros.</FONT></B>
<P><B><IMG SRC="images/ball_gre.gif" WIDTH="14" HEIGHT="14" ALIGN="BOTTOM"
NATURALSIZEFLAG="3"><FONT SIZE=+1>Cuentas Contables.</FONT></B>
<P><B><IMG SRC="images/ball_gre.gif" WIDTH="14" HEIGHT="14" ALIGN="BOTTOM"
NATURALSIZEFLAG="3"><FONT SIZE=+1>Claves.</FONT></B>
<P><B><IMG SRC="images/ball_gre.gif" WIDTH="14" HEIGHT="14" ALIGN="BOTTOM"
NATURALSIZEFLAG="3"><FONT SIZE=+1>Condiciones de pago.</FONT></B>
<P><B><IMG SRC="images/ball_gre.gif" WIDTH="14" HEIGHT="14" ALIGN="BOTTOM"
NATURALSIZEFLAG="3"><FONT SIZE=+1>Bancos.</FONT></B>
<P><B><IMG SRC="images/ball_gre.gif" WIDTH="14" HEIGHT="14" ALIGN="BOTTOM"
NATURALSIZEFLAG="3"><FONT SIZE=+1>Documentos de pago.</FONT></B>
<P><B><IMG SRC="images/ball_gre.gif" WIDTH="14" HEIGHT="14" ALIGN="BOTTOM"
NATURALSIZEFLAG="3"><FONT SIZE=+1>Previsiones de pago.</FONT></B>
<P><B><IMG SRC="images/ball_gre.gif" WIDTH="14" HEIGHT="14" ALIGN="BOTTOM"
NATURALSIZEFLAG="3"><FONT SIZE=+1>Informes.</FONT></B>
<P><B><IMG SRC="images/ball_gre.gif" WIDTH="14" HEIGHT="14" ALIGN="BOTTOM"
NATURALSIZEFLAG="3"><FONT SIZE=+1>Traspaso.</FONT></B>
<P><B><IMG SRC="images/ball_gre.gif" WIDTH="14" HEIGHT="14" ALIGN="BOTTOM"
NATURALSIZEFLAG="3"><FONT SIZE=+1>Copias.</FONT></B>
<P>&nbsp;
</UL>
<H3>Soporte T&eacute;cnico y servicios.</H3>
<H3>&nbsp;</H3>
<H3><HR ALIGN=LEFT></H3>
<H1><IMG SRC="images/SGRP.jpg" BORDER="2" HEIGHT="76" WIDTH="86" NATURALSIZEFLAG=
"0" ALIGN="BOTTOM"></H1>
</BODY>
</HTML>

23
help_navbar.html Normal file
View File

@ -0,0 +1,23 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE></TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (Win95; I) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#003366" VLINK="#333399" ALINK="#FF0000" BACKGROUND="images/backgrnd.gif">
<P><!-- application: Tock --><!-- version: 1.0 --><!-- company name: Internet Media Services --><!-- filename: help_navbar.html --><!-- description: navigation bar for online help --></P>
<TABLE WIDTH="100%" >
<TR>
<TD align="left" valign="top"><A HREF="help_contents.html" target="topic"><IMG SRC="images/content1.gif" BORDER=0 HEIGHT=37 WIDTH=44></A>
<!-- <a HREF="help_initial.html" target="topic"><img src="images/index1.gif" border=0 height=37 width=44></a> --><A HREF="javascript:parent.frames[1].history.go(-1)"><IMG SRC="images/back1.gif" BORDER=0 HEIGHT=37 WIDTH=44></A>
<A HREF="javascript:parent.frames[1].history.go(1)"><IMG SRC="images/forward1.gif" BORDER=0 HEIGHT=37 WIDTH=44></A>
</TD>
<TD align="right" valign="top"><A HREF="javascript:top.close()"><IMG SRC="images/exit1.gif" BORDER=0 HEIGHT=37 WIDTH=44></A>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

432
helptopics.html Normal file
View File

@ -0,0 +1,432 @@
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="Adobe PageMill 2.0 Win">
<TITLE>Tock Help</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
<P><IMG SRC="images/help.gif" ALT="Help" WIDTH="122" HEIGHT="59" NATURALSIZEFLAG=
"0" ALIGN="BOTTOM"> <BACKGROUND="images/backgrnd.gif"> <HR ALIGN=LEFT><A
NAME="intro"></A></P>
<H2>Introducci&oacute;n. &iquest;Que es?, &iquest;Que hace?.</H2>
<!--
<P><A NAME="creators"></A></P>
<H3>About the Creators of Tock</H3>
<P><A HREF="http://www.imservice.com/">Internet Media Services (IMS)</A>
designs and builds database applications for the Internet and corporate
Intranet. The Tock time tracking system demonstrates IMS's commitment to
creating robust web applications with intuitive, easy to use interfaces.</P>
<P><B>If you would like IMS to customize Tock for your organization or consult
with you to create other Internet/Intranet applications, please contact
at <A HREF="http://www.imservice.com/tock/forms/request.html">sales@imservice.com
</A>or (415) 617-0701. </B></P>
<P><A HREF="http://www.imservice.com/clients/initial.html">Other IMS web-based
solutions</A> include an employee directory / &quot;expert&quot; locator,
project management system, computer-based training, operations monitoring,
data collection, newsfeed displays, and research and reporting applications.
<A NAME="application"></A></P>
<H3>About the Application</H3>
<P>Tock is an application for logging time spent on projects, and generating
reports which can be used for payroll, billing, and project management.
This is an essential application for anyone whose business relies on managing
and reporting time spent on projects. <HR ALIGN=LEFT><A NAME="techsup"></A></P>
<H2>Tecnolog&iacute;a y plataforma.</H2>
<P>Tock is distributed free of charge as an unsupported application. However,
IMS provides a Frequently Asked Questions (FAQ) forum for Tock users, and
welcomes your comments and suggestions.</P>
<UL>
<P>For HELP using Tock, check out the <A HREF="http://www.imservice.com/tock/faq/initial.html">Tock
FAQ</A> on the <A HREF="http://www.imservice.com/">IMS</A> web site.
<P>To REPORT BUGS or other critical issues, SUGGEST feature changes/additions,
or just send your COMMENTS, send email to <A HREF="http://www.imservice.com/tock/forms/comments.html">tock@imservice.com
</A>
<P>If you would like <A HREF="http://www.imservice.com/">IMS</A> to install
a CUSTOMIZED VERSION of Tock or to discuss the development of other Intranet/Internet
applications, send email to <A HREF="http://www.imservice.com/tock/forms/request.html">sales@imservice.com
</A>or call (415) 617-0701.
</UL>
//-->
</SCRIPT>
<P><HR ALIGN=LEFT><A NAME="userguide"></A></P>
<H2>Esquema y estructura de datos. Como Usar esta Aplicaci&oacute;n:</H2>
<P><A NAME="entry"></A></P>
<H3>Como usar cursor, rat&oacute;n y navegador.</H3>
<P>En primer lugar significar que con el rat&oacute;n funciona todo solamente
apuntando al campo o a la opci&oacute;n a utilizar.</P>
<P>Para avanzar el cursor de un campo a otro solo se puede hacer con el
tabulador, para retroceder al anterior shitf + tabulador, una vez terminados
de rellenar los campos necesarios se desplaza el cursor con el tabulador
o con el rat&oacute;n directamente hacia la opci&oacute;n que necesite (busqueda,
confirmar, ver, alta, etc..) y se pulsa la barra espaciadora(*).</P>
<P>Para enfocar de un frame(*) a otro solo se puede hacer con el rat&oacute;n,
por ejemplo:</P>
<P> En la pantalla de facturas, &eacute;sta aparece a su derecha (1 frame),
y el menu principal a su izquierda (2&ordm; frame, mas peque&ntilde;o),
si quiere trabajar en facturas debe de apuntar a ese frame con el rat&oacute;n
para que el cursor se sit&uacute;e al principio y la misma operaci&oacute;n
debe realizar si quiere paar al frame peque&ntilde;o, del men&uacute; principal
en este caso.</P>
<P>* La barra espaciadora en este caso hace la misma funci&oacute;n que
INTRO.</P>
<P>* Se puede definir Frame como una pantalla dentro de otra que puede ser
de diversos tama&ntilde;os.</P>
<H4>Navegador Netscape Gold 3.0.</H4>
<P>Algunos conceptos b&aacute;sicos para el uso del navegador:</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<H3>Running Reports</H3>
<P><B>Step One: Enter the Date</B></P>
<P>The first step for all reports is to select a date range. If you do not
select a date range your report will default to the last 7 days (including
today).</P>
<P>To select a date range click on the radio button associated with either
a set amount of time (last 7 days, last 14 days or month to date) or input
your own date range in mm/dd/yy format.</P>
<P>Last 7 days, 14 days and month to date all include date from today.</P>
<P>&nbsp;</P>
<P><B>Step Two: Choose either a summary or detail report</B></P>
<P>To run a <B>summary report</B> select how you want the report broken
down from the pop up menu and click on the Create Summary Report button.</P>
<P>&nbsp;</P>
<UL>
<LI>A summary report by employee lists the total hours entered for each
employee during the date range you selected. <BR>
<LI>A summary report by project lists the total hours entered for each
project during the date range you selected. <BR>
<LI>A summary report by group lists the total hours entered for each group
during the date range you selected. <BR>
<LI>A summary report by category lists the total hours entered for each
category during the date range you selected.
<P>To run a<B> detail report</B> you first choose one of the four categories:
Employee, Group, Project or Type of Work by clicking on the corresponding
radio button. Then use the select list to choose the item for which you
would like generate a report. Click Create Detail Report to produce the
report.
<P>&nbsp;
<P><A NAME="edit_report"></A><B>Editing Your Entries</B>
<P>You can edit your hours entries from the report section. Select your
name in the employee list under Detail Report. Select all entries in the
select list. Click CREATE DETAIL REPORT to run the report. Click a field
of the entry you want to edit. Change whatever details you want, then click
Update to save your changes.
<P><HR ALIGN=LEFT><A NAME="prefs"></A><H3>Preferences and User Information</H3>
<P><B>Entering your information</B>
<P><B>Password:</B> Your user name and a temporary password will be added
to the system by your administrator. You may go in at any time to change
your password by clicking on Change Password link. You will need to know
your current password to change your password.
<P>You can update most of your information by changing the text or selection
lists on the preferences page and then clicking the SAVE CHANGES button.
<P>Only your administrator can change your active status, full/part time
status, and group.
<P><B>User Preferences</B>
<P><B>Active Projects:</B> The projects you select here will show up on
your hours entry page. You may select as many as you like (you may need
to hold down the control or apple key to make multiple selections). If
a project you will be working on is not listed, contact your administrator.
<P><B>Default Project:</B> Select the project that you work on the most
often from the pop up menu (it must be one of your active projects). Your
enter hours page will default to this project if no other project is selected.
<P><B>Default Type of Work:</B> Select the type of work that you do the
most often from the pop up menu. Your enter hours page will default to
this type of work if no other type of work is selected.
<P>After making any changes click on SAVE CHANGES and your information
will be updated to the database.
<P><HR ALIGN=LEFT><A NAME="admin"></A><H3>Administration</H3>
<P><B>Add User:</B> Enter the user's information and click on Add User.
Required information is: first name, last name, user name, temporary password,
group, and project information. You can update this information at any
time. Only administrators can edit the active status, full/part time status,
and group fields. The user's login, password, first name, last name, title,
email, and phone can not contain double quotes. The user's email and phone
can not contain single quotes.
<P><B>Add Group:</B> Type in the group name. Choose group members from
the select list. You may select as many as you wish (you may need to hold
down the control or apple key to make multiple selections). Remember, a
user can only be a member of one group at a time. Click on Add Group. The
group name can not contain single or double quotes.
<P><B>Add Project:</B> Type in the project name. Choose Active or Inactive,
and Billable or Non Billable from the select lists. Click on Add Project.
The project name can not contain single or double quotes.
<P><B>Add Type of Work:</B> Type in the name of the new type of work. Click
on Add Type of Work. The name of the type of work can not contain single
or double quotes.
<P><B>Edit User:</B> Choose a user from the select list that you would
like to edit and click on USER. Follow the same directions for Add User
to edit user information. Click SAVE CHANGES to update the user information.
To delete a user click on Delete User. You may only delete a user if they
have never entered any hours. If you want to prevent a user from logging
in, make the user inactive. The user's login, password, first name, last
name, title, email, and phone can not contain double quotes. The user's
email and phone can not contain single quotes.
<P><B>Reset Password:</B> If a user has forgotten his or her password,
select the user from the list and click USER. From the user information
screen, click on Reset Password. This will reset the user's password to
his or her user id.
<P><B>Edit Group:</B> To edit the group name only, change the name and
then click on UPDATE THIS GROUP. You can also move users into and out of
the group you are editing. A user can only be in one group at a time. If
you remove a user from a group they will be put into the special group
called No Group. If you add a user to a group you will automatically take
him or her out of the group he or she is in currently.
<P><B>Group Members, Group Name:</B> If you choose a name from this select
list and click on UPDATE THIS GROUP this person will be removed from the
group and added to No Group. The group name can not contain single or double
quotes.
<P><B>All Other Employees:</B> If you choose a name from this select list
and click on UPDATE THIS GROUP this person will be added to the group which
you are editing and deleted from whatever group s/he was in previously.
<P><B>Deleting a Group:</B> You may only delete a group if it has no members.
Once you remove all of the members, click on DELETE THIS GROUP.
<P><B>Edit a Project:</B> You may a edit the project name by changing the
text and clicking on UPDATE PROJECT. You may also change the status of
a project: Inactive or Active and Billable or Non Billable; by selecting
the correct status from the select lists and then clicking on UPDATE PROJECTS.
A project cannot be deleted if hours have been entered for it. If you no
longer need a project, make it project inactive. The project name can not
contain single or double quotes.
<P><B>Edit Type of Work:</B> You may change the type of work by changing
the text and then clicking on UPDATE TYPE OF WORK. You may not delete a
category if hours have been entered using that type of work.
<P>The name of the type of work can not contain single or double quotes.
<HR ALIGN=LEFT><A NAME="troubleshooting"></A><H2>Troubleshooting and Known
Problems</H2>
<P><h4>Navigator 2.0</h4> This application is <B>not</B> recommended for
use with Navigator 2.0.x. Several problems in 2.0 versions of Navigator
prevent some areas of the application from working properly. These include
(but may not be limited to):
<UL>
<LI>Radio buttons are ordered differently for JavaScript in Navigator 2.0.x
and 3.0. On the reports screen the radio buttons will not be selected properly
using Navigator 2.0.x. On Navigator 2.0.x for the Macintosh, it's possible
to have more than one radio button selected.
<LI>The help system does not work for Navigator 2.0.x Unix versions.
<LI>Java Script functions are sometimes not called correctly using Navigator
2.0.x. This problem has been reported on the login screen, on the hours
entry screen, and on the reports screen.
</UL>
<P>The Java applet on the hours entry screen uses Live Connect to update
itself based on user input. This functionality is only available with Netscape
3.0 browsers.
<P><h4>Admin privileges</h4> You can delete all users with admin privileges.
If you do this, you will not be able to create new users or change the
admin privileges of users to get admin privileges back. We recommend that
you do not ever delete the admin user created during the install (username
admin, password admin) in case you accidentally remove admin privileges
from all other uses.
<P><h4>Alphabetical Order</h4> Every list of projects, types of work, users,
etc. is alphabetized. However, the lists are alphabetized using ASCII collating
sequence, which means that lowercase letters come after uppercase letters.
If your projects, types of work, etc. start with both upper and lowercase
letters, the entries will not seem to be ordered. We recommend that you
start all items with either uppercase or lowercase letters, not both.
<P><h4>Logging out and the back button</h4> After you log out of the system,
you can still see screens using the back button. If you try to click on
anything on these screens, you will be asked to log in again. If you have
sensitive information on these screens, you may want to exit the browser
before leaving your machine.
<P><h4>Dates</h4> Java Script can not work with dates before 1970. If you
enter a two digit year less than 70 (for example, 8/5/15), the year will
be added to 2000 (for the previous example, the date will become 8/5/2015).
<P><h4>Entering hours</h4> Although the Java applet graph updates as you
enter hours, this information is not saved in the database until you click
Save. <h4>Deleting a project, group, or category</h4> A project or category
cannot be deleted if hours have been entered which reference it. You can
make a project inactive, which will prevent it from appearing in reports.
Groups can be only be deleted if they have no members. Put everyone in
the group you'd like to delete in different groups, then delete the group.
<h4>Screen not displaying properly</h4> Try resizing your browser or reloading
the page. <h4>I typed in a URL and it loaded the hours entry screen instead</h4>
You do not have the privileges to see the page you requested, or you attempted
to view a page which was not intended to be accessed directly. You should
be able to use every feature of the application from the button bar or
links within the pages. If you're interested in looking at the source code,
use an external viewer. <h4>I entered comments with my hours, but they're
not showing up in the report</h4> Comments are printed only for the show
all entries reports. For all other reports, each line may be representing
multiple entries.
<P><HR ALIGN=LEFT><A NAME="devguide"></A><H2>How This Application Works</H2>
<P><h3>General</h3> <h4>Project variables</h4> Tock uses project variables
to minimize the number of database lookups which must be performed. Because
the project variables are available to all users of the application, they
only need to be set once, and reset as needed. Tock stores lists of work
types, projects, groups, and employees. Pages which use these values call
load functions to set these variables if they have not been set already.
<P><h4>Access control</h4> The application uses LiveWire's client cookies
to maintain state. This means that until the user's cookies expire, she
or he will be recognized by the system and won't have to enter a user name
and password every time. A logout function erases these cookies so that
another person can use the same machine to access the application using
her own login. This is also useful to prevent access after leaving the
machine unattended.
<P>Tock also stores a number of useful data items using client cookies.
These cookies are used to store items such as the user's id, login name,
full name, default project, default category, list of active projects,
and the page the user came from.
<P>In addition to cookies, Tock uses a simple security scheme to verify
that the user has actually passed through the login screens. This consists
of setting a cookie whose name is determined at login time, and then checking
whether this cookie is set before displaying a page.
<P>Some pages in this application should never be accessed directly, such
as pages that perform database actions based on form input. In order to
access one of these pages, the prevPage cookie must be set to the correct
value. The only way to set this value correctly is to click submit on the
page which provides the form input for the page. This prevents users from
typing in URLs and seeing pages they shouldn't.
<P>On each page, the function checkPrevPage is called with the name of
the current page. This function
<UL>
<LI>checks whether there is a connection to the database
<LI>verifies that the user has logged in correctly
<LI>if a page has a prerequisite, checks that the user is coming from the
correct page using the prevPage cookie
</UL>
<P>If any of these checks fail, the user is redirected to the login screen.
If the user is logged in, s/he will go directly to the enter hours screen.
If all checks succeed, the prevPage cookie is set to the current page and
processing continues.
<P>A similar process is used to check a user's admin status before displaying
pages that only admins should be able to see. The function lookupAdminStatus
performs a database query to determine whether a user has admin privileges.
<P><h4>Input validation</h4> Tock uses Java Script extensively to validate
user input and provide immediate feedback. This prevents having to switch
back and forth between the form screen and an error screen, trying to determine
what went wrong. Java Script is used to ensure that dates are valid, date
ranges make sense, fields are not too long for the database, all necessary
selections have been made, and that database constraints are enforced.
<P><h4>Database interaction</h4> Tock uses Live Wire's database connectivity
in every aspect of its functionality. The data users enter on the hours
entry screen is saved to the database, where it is immediately available
for producing reports. The reports retrieve information from the database
and present it in a variety of views so that it is useful to the user.
User preference information is stored in the database and used to customize
the application on the fly for each user. The admin section provides an
easy to use way to administer the Tock database.
<P><h3>Hours Entry</h3> The hours entry screen uses a form to collect information
about the date, project, category, and number of hours a user has worked,
and stores this information in the database.
<P>The hours entry screen contains a Java applet which graphs a user's
hours based on entries in the database. It also takes advantage of Live
Connect to update the graph every time the user enters hours on the form.
The date field, hours, and hours fraction fields all have onChange event
handlers which determine if the graph should be updated, and if so, call
a Java method to instantly change the graph.
<P>The date field uses a Java Script function to ensure that the user has
entered a valid date. A warning pops up if the date is not valid.
<P>The list of projects each user sees is determined at page generation
time from the user's list of active projects in the database. This list
can be changed at any time using the preferences screen. Any projects which
are made inactive will not appear in the list.
<P>If a user attempts to enter more than 24 hours for a single day this
week, a warning pops up and the hours for the entry are reset. For hours
outside this week, the user cannot enter more than 24 hours on the form.
As the hours entries are inserted into the database, each entry is checked
to see whether it puts the user over 24 hours for a day. If so, the hours
for that are set to 0, all other information is retained, and the user
is warned and asked to edit the entries for that day.
<P>Comments have a maximum length of 250 characters. If the user types
a comment longer than this, the user has the option of truncating the comment
or editing it to be under 250 characters.
<P><h3>Reports</h3> The reports screen is a form which allows the user
to define a view of the hours data. The form input is used to construct
database queries. The results of these queries are formatted using Java
Script functions. This methodology should be easily extensible should a
developer which to add new types of reports, since s/he would need only
to construct a new query and could use the existing functions to format
and display the report.
<P>The reports screen uses Java Script to ensure that the date range entered
by the user is valid and that the user has selected an item from the select
list for they type of report s/he wants to generate. The radio button next
to each select list is checked automatically using the onChange event handler
when the user selects an item from the select list.
<P><h3>Preferences</h3> The preferences screen is where users can change
their vital data, current active projects, and defaults.
<P>The preferences screen uses Java Script functions to ensure that all
entries are valid and that a user's default project is also one of her/his
active projects. Clicking save changes causes the information to be updated
in the database and forces a reload of the user's preference information.
<P><h3>Admin</h3> The admin section uses forms to allow users to perform
a variety of functions. This section of the application can only be accessed
by users who have admin privileges.
<P>The admin screen uses Java Script to ensure that a user has chosen an
item to edit before clicking the submit button. Each of the screens in
the admin interface also uses Java Script to validate user input. For groups,
projects, and work types, a Java Script function called when the user clicks
Save checks that the name of the item is not already being used. Names
are also checked for length limits and illegal characters.
<P>A delete button is only displayed if the item can be deleted without
violating database integrity constraints. This is determined as the page
is generated by querying the database about the existence of items which
would prevent a legal delete.
<P>After adding or editing an item, the default status line message is
set to a message reflecting the change with the onLoad event handler. The
onUnload event handler is used to turn the message off once the user leaves
the page.
<P><A NAME="dbschema"></A><H2>Database Schema</H2>
<P>&nbsp;
<DL>
<DT><B>category</B> table
<DD>unique ids and names of types of work
<DT><B>group</B> table
<DD>unique ids and names of groups
<DT><B>group_people</B> table
<DD>user ids and group ids which specify group affiliations for users
<DT><B>hours</B> table
<DD>hours entries: date, user, number of hours, project, category, and
description
<DT><B>project</B> table
<DD>unique ids, names, active status, and billable status of projects
<DT><B>user</B> table
<DD>user information: id, login, password, name, title, phone, email, active
status, full/part time status, admin privileges, default project and default
category
<DT><B>user_projects</B> table
<DD>user ids and project isd which specify the active projects for users
</DL>
<P>&nbsp;
</UL>
<H2>Soporte t&eacute;cnico y servicios.</H2>
<UL>
<P><CENTER>&nbsp;</CENTER>
</UL>
</BODY>
</HTML>

78
home.html Normal file
View File

@ -0,0 +1,78 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Cuentas a Pagar (SANDO)</TITLE>
<META NAME="Author" CONTENT="Admisys S.L. webteam">
<META NAME="Description" CONTENT="Página para aplicación de Cuentas a Pagar">
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (Win95; I) [Netscape]">
</HEAD>
<BODY BACKGROUND="images/gray_rock.gif">
<DT>&nbsp;</DT>
<CENTER><TABLE BORDER=2 >
<CAPTION></CAPTION>
<TR>
<TH ALIGN=LEFT VALIGN=CENTER BGCOLOR="#FFFFFF"><A HREF="http://ctasapagar"><IMG SRC="images/SGRP.jpg" BORDER=0 HEIGHT=76 WIDTH=86></A>
</TH>
<TD><!--
<param name="bgImage" value="images/backgrnd.gif">
--><APPLET code="Banners.class" width="500" height="50"><PARAM name="borderColor" value="black"><PARAM name="bgImage" value="images/gray_rock.gif"><PARAM name="textColor" value="1BC065"><PARAM name="pause" value="1"><PARAM name="exit" value="scrollLeft"><PARAM name="shadowDepth" value="2"><PARAM name="align" value="Center"><PARAM name="fps" value="20"><PARAM name="repeat" value="1"><PARAM name="bgExit" value="None"><PARAM name="messages" value="Construcciones Sánchez Domínguez S.A. | Construcciones SANDO {font=TimesRoman} {style=Bold} {repeat=2} {bgEnter=Squeeze} {bgExit=Squeeze} {textColor=FF0080} {emboss=true}"><PARAM name="font" value="Helvetica"><PARAM name="cpf" value="2"><PARAM name="enter" value="scrollLeft"><PARAM name="bgEnter" value="None"><PARAM name="style" value="BoldItalic"><PARAM name="size" value="36"><PARAM name="shadowColor" value="darkGray"></APPLET></TD>
</TR>
</TABLE></CENTER>
<H4>
<HR SIZE=20 WIDTH="100%"></H4>
<CENTER><TABLE BORDER=1 BGCOLOR="#FFFFFF" >
<TR>
<TD><A HREF="http://ctasapagar/Ctas_a_Pagar"><IMG SRC="images/handanimated.gif" BORDER=0 HEIGHT=25 WIDTH=35></A><B><I><FONT COLOR="#1BC065"><FONT SIZE=+2><A HREF="http://ctasapagar/Ctas_a_Pagar">Dpto.
Cuentas a Pagar</A></FONT></FONT></I></B></TD>
</TR>
</TABLE></CENTER>
<P><BR>
&nbsp;<BR>
<BR>
</P>
<CENTER><TABLE BORDER=4 >
<TR VALIGN=TOP>
<TD WIDTH="100%" HEIGHT="100%" BGCOLOR="#FFFFFF">
<DT><A HREF="http://ctasapagar" target="main"><IMG SRC="images/sando.jpg" BORDER=0 HEIGHT=80 WIDTH=265></A></DT>
</TD>
</TR>
</TABLE></CENTER>
<P>
<HR SIZE=20 WIDTH="100%"></P>
<CENTER><TABLE BORDER=1 BGCOLOR="#FFFFFF" >
<TR>
<TD WIDTH="50%">
<ADDRESS><BASE target="contents"><IMG SRC="images/emailed.gif" HEIGHT=52 WIDTH=45><B><FONT SIZE=+1><A HREF="mailto:%20%3Cinfo%3Esando_malaga@admisys.com">Construcciones
SANDO SA</A> </FONT></B></ADDRESS>
<ADDRESS><ctasapagar><FONT SIZE=+1><A HREF="mailto:%3Cctasapagar%3Esando_malaga@admisys.com">Departamento
de Cuentas a Pagar<BR>
<BR>
</A></FONT><FONT SIZE=-1>Last modified: 5/2/97 </FONT></ADDRESS>
</TD>
<TD>
<CENTER><ADDRESS><FONT COLOR="#008000">c<B><I>/ Jos&eacute; Ortega y Gasset
194-196</I></B></FONT></ADDRESS></CENTER>
<CENTER><ADDRESS><B><I><FONT COLOR="#008000">29006 MALAGA</FONT></I></B></ADDRESS></CENTER>
<CENTER><ADDRESS><B><I><FONT COLOR="#008000">Tfno: 34 - 5 -232 20 00 </FONT></I></B></ADDRESS></CENTER>
<CENTER><ADDRESS><B><I><FONT COLOR="#008000">Fax : 34 - 5 - 234 75 48</FONT></I></B></ADDRESS></CENTER>
</TD>
</TR>
</TABLE></CENTER>
</BODY>
</HTML>

128
initial.html Normal file
View File

@ -0,0 +1,128 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Inicio</TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/4.0b1 (Win95; I) [Netscape]">
<SCRIPT language="JavaScript">
function validate() {
if (!document.login.username.value) {
alert("Debe introducir un nombre de usuario y una clave de acceso!");
return false;
}
document.login.prevPage.value = "initial.html submit";
return true;
}
</SCRIPT>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
</HEAD>
<BODY BACKGROUND="images/BG.JPG">
<P><!-- application: Cuentas a Pagar -->
<!-- version: 1.0 -->
<!-- company name: AdmiSys -->
<!-- filename: initial.html -->
<!-- description: initial and default page of the application -->
<!-- application returns here whenever a non-database -->
<!-- error occurs. checks if user is logged in, -->
<!-- prompts for id and password if not, else goes to -->
<!-- main application screen. -->
<SERVER>
chkBrowser();
<!-- this is the only page where client.prevPage doesn't matter -->
client.prevPage = "initial.html";
client.es_inicio = 1;
dbConnect();
<!-- if we know who the user is already, go direct to enter hours -->
if (!request.ipw && client.username != "null" && client.username != null) {
// if (!loggedIn()) <!-- session expired -->
// redirect("logout.html");
// else
// if (request.err)
// redirect("multi_entry.html");
// else
redirect("ctasapagar.html?FrameType="+request.FrameType);
}
if (request.err)
redirect("logged_out.html");
</SERVER></P>
<DIV ALIGN=CENTER><TABLE BORDER=4 WIDTH="100" HEIGHT="100" BGCOLOR="#FFFFFF" >
<TR><TD>
<DT><A HREF="http://ctasapagar"><IMG SRC="images/sand2new.gif"
ALT="Construcciones SANDO" BORDER=0 HEIGHT=117 WIDTH=424 ALIGN=RIGHT></A>
<A HREF="http://ctasapagar">&nbsp;</A></DT>
</TD></TR>
</TABLE>
<H1>Departamento de Cuentas a Pagar</H1>
<TABLE>
<TR>
<TD colspan=2 align=right><DT>
<FORM name="login"
method="post"
action="login.html"
onSubmit="return validate()">
</DT>
<TR valign=baseline><TD><DT>
<SERVER>
<!-- if request.ipw is set, the user has entered an incorrect login -->
<!-- or password. -->
if (request.ipw) {
writeln("<td><b><i>El nombre de usuario o el password<br>es incorrecto.</i></b></td>");
}
</SERVER>
</DT>
</TD><DT></DT>
<TD align=right><H3>USER</H3></TD>
<TD><DT>
<SERVER>
if (client.username != "null" && client.username != null)
writeln(" <input name=\"username\" type=\"text\" size=\"15\" value=\""+client.username+"\">");
else
writeln(" <input name=\"username\" type=\"text\" size=\"15\">");
</SERVER>
</DT></TD></TR>
<TR valign=baseline><TD><DT>
<SERVER>
if (request.ipw)
writeln("<td><b><i>Por favor Intentar otra vez.</i></b></td>");
</SERVER>
</DT></TD>
<TD align=right><H3>PASSWORD</H3></TD>
<TD><DT><INPUT name="password" type="password" size="15"></DT></TD></TR>
<TR><TD><DT>
<SERVER>
if (request.ipw)
writeln("<td></td>");
</SERVER>
</DT></TD>
<TD><DT>&nbsp;</DT></TD>
<TD align=right><DT>
<INPUT name="Submit" type="submit" value="ENTER">
<INPUT name="prevPage" type="hidden"></DT>
</TD>
</TR>
</TABLE></DIV>
<DIV ALIGN=CENTER><P>
<DT><B>Estructura P&aacute;gina:</B>
&nbsp;<INPUT TYPE="radio" NAME="FrameType" VALUE="F" >Completa
&nbsp;<INPUT TYPE="radio" NAME="FrameType" VALUE="L" CHECKED>Lateral
&nbsp;<INPUT TYPE="radio" NAME="FrameType" VALUE="T" >Cabecera
</DT><DT>&nbsp;</DT><BR>
<DT><B>Visualizar Descripciones de Claves:</B>
&nbsp;<INPUT TYPE="radio" NAME="ViewFkey" VALUE="S" >Si
&nbsp;<INPUT TYPE="radio" NAME="ViewFkey" VALUE="N" CHECKED>No
</DT></P>
<DT><B>Visualizar Mensaje:</B>
&nbsp;<INPUT TYPE="radio" NAME="MsgScroll" VALUE="S" >Si
&nbsp;<INPUT TYPE="radio" NAME="MsgScroll" VALUE="N" CHECKED>No
</DT></P>
<DT>&nbsp;</DT>
</FORM></DIV>
<SERVER>writeSignature(true);</SERVER>
<BR><CENTER>Last modified: 27/2/97&nbsp;</FONT></DT></CENTER>
</BODY>
</HTML>

368
l_albaran.html Normal file
View File

@ -0,0 +1,368 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: l_albaran.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>Listado de albaranes</TITLE>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT SRC="l_albaran.js">
</SCRIPT>
</HEAD>
<SERVER>
var NF6=""
var NF8=""
var NF9=""
var NF10=""
var HOY=new Date();
// Algunos formatos para fechas.
var NLDF=""; // para columnas en las queries INFORMIX
var nprinter="";
var spoolpath="";
var baseHtml="";
var textoReqs="";
var nomFile="c:/tmprpts/empty";
fileRpt=new File(nomFile);
fileRpt.close();
var PaperVLines=76// Nro. Lins. del Papel A4 Vertical FONT Default
var PaperHLines=52// Nro. Lins. del Papel A4 Horizontal FONT Default
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons();GoField()"');
else
writeln(' <BODY OnLoad="GoField()"');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="albaran.js">');
writeln('</SCRIPT>');
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln(' function GoField() {');
writeln(' var f=document.l_albaran; ');
writeln('// alert("\\r¡¡¡ !!!"); ');
if (!request.f_orden)
writeln(' f.f_formato.focus();');
if (request.f_orden)
writeln("displayReport();");
writeln(' }');
writeln(' function chkYearNroReg(obj) {');
writeln(' var nro=parseInt(obj.value); ');
writeln(' if (nro+1 > 0 ) { ');
writeln(' obj.value=nro; ');
writeln(' if ( HOY.getFullYear() != nro ) ');
writeln(' alert("¡¡ El Año del Nro. de Registro no es el actual !! ");');
writeln(' }');
writeln(' }');
writeln('function NroPad(obj,longNro) {');
writeln(' if ( obj.value.length == 0 )');
writeln(' return;');
writeln(' if (obj.value.indexOf("*") >= 0) ');
writeln(' return;');
writeln(' c_nro=obj.value;');
writeln(' for (var j=c_nro.length ; j<longNro ; j++ ) {');
writeln(' c_nro="0"+c_nro;');
writeln(' }');
writeln(' obj.value=c_nro.substring(0,longNro);');
writeln('}');
if (request.gofunc) {
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_albaran;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="l_albaran.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
}
writeln('</SCRIPT>');
if( request.f_orden) {
if (!request.gofunc) {
dbConnect();
if (request.desde && request.hasta) {
var desde_fecha=DateFormat(request.desde,NLDF);
if ( desde_fecha.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
var hasta_fecha=DateFormat(request.hasta,NLDF);
if ( hasta_fecha.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
c_albaranes = database.cursor("SELECT * FROM albaranes,proveedores WHERE albaranes.nif=proveedores.nif and "+ client.criteria +" Between '" +
desde_fecha + "' and '"+ hasta_fecha + "' ORDER BY " + client.criteria);
}
else if (request.search1) {
c_albaranes = database.cursor("SELECT * FROM albaranes,proveedores WHERE albaranes.nif=proveedores.nif and "+ client.criteria +" MATCHES '" +
request.search1 + "' ORDER BY " + client.criteria);
}
else if (request.f_orden) {
var criterio=""
if ( request.f_desde.length > 0 ) {
var f_desde=DateFormat(request.f_desde,NLDF);
if ( f_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
criterio=" f_emision >= '"+f_desde+"' "
}
if ( request.f_hasta.length > 0 ) {
var f_hasta=DateFormat(request.f_hasta,NLDF);
if ( f_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" f_emision <= '"+f_hasta+"' "
}
if ( request.h_cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" albaranes.cod_centro >= '"+request.d_cod_centro+"' and albaranes.cod_centro <= '"+request.h_cod_centro+"' "
} else {
if ( request.d_cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" albaranes.cod_centro matches '"+request.d_cod_centro+"'"
}
}
if ( request.nif.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" albaranes.nif matches '"+request.nif+"'"
}
if ( request.h_nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" albaranes.fra_reg >= '"+request.d_nro_fra+"' and albaranes.nro_fra <= '"+request.h_nro_fra+"'"
} else {
if ( request.d_nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" albaranes.fra_reg >= '"+request.d_nro_fra+"'"
}
}
if ( request.h_nro_reg.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" albaranes.nro_reg >= '"+StringClip(true,request.d_nro_reg)+"' and albaranes.nro_reg <= '"+StringClip(true,request.h_nro_reg)+"'"
} else {
if ( request.d_nro_reg.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" albaranes.nro_reg >= '"+StringClip(true,request.d_nro_reg)+"'"
}
}
if ( request.razon_social.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
var razon_social=request.razon_social;
// var lowcaps = request.razon_social.toLowerCase();
// var uppercaps = request.razon_social.toUpperCase();
criterio=criterio+"razon_social matches '"+razon_social+"'"
}
if (request.f_formato=="proveedor")
request.f_orden=" albaranes.nif,"+request.f_orden;
if (request.f_formato=="centro")
request.f_orden=" albaranes.cod_centro,razon_social,"+request.f_orden;
if (request.f_formato=="pendientes") {
request.f_orden=" albaranes.cod_centro,razon_social,"+request.f_orden;
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+"fra_reg matches ' *' "
}
if (request.f_formato=="emitidas") {
request.f_orden=""+request.f_orden;
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+"fecha_emision is not null "
}
if (request.f_formato=="provBloq")
request.f_orden=" albaranes.nif,"+request.f_orden;
// if (request.f_formato=="documento")
// request.f_orden=" albaranes.nif,"+request.f_orden;
if (criterio.length > 0 )
criterio=" and "+criterio;
c_albareg = database.cursor("SELECT * FROM albaranes,proveedores,centros WHERE albaranes.nif=proveedores.nif and albaranes.cod_centro=centros.cod_centro"+ criterio +
" ORDER BY " + request.f_orden);
}
if (!c_albareg)
DbsError(false,-1);
else {
report_alb();
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln("function displayReport() {");
if ( textoReqs.length > 0 )
writeln(' alert("Listado(s): '+textoReqs+'\\r está(n) en la cola \''+nprinter+'\'"); ');
writeln("}");
writeln("</SCRIPT>");
c_albareg.close();
}
}
}
criterio="Listado";
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RangoFecha(obj,clave) {');
writeln(' if (obj.value.length > 0 ){ ');
writeln(' if (clave == "emision") { ');
writeln(' if (dateCmp(obj.value,document.l_albaran.f_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_albaran.f_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "vto") { ');
writeln(' if (dateCmp(obj.value,document.l_albaran.v_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_albaran.v_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "fecha") { ');
writeln(' if (dateCmp(obj.value,document.l_albaran.desde.value) != 1 ) {');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_albaran.desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' } ');
writeln('} ');
writeln('function HastaDefault(obj,clave) {');
writeln(' if (obj.value.length <= 0 ){ ');
writeln(' if (clave == "emision") ');
writeln(' obj.value=document.l_albaran.f_desde.value;');
writeln(' if (clave == "vto") ');
writeln(' obj.value=document.l_albaran.v_desde.value;');
writeln(' if (clave == "fecha") ');
writeln(' obj.value=document.l_albaran.desde.value;');
writeln(' } ');
writeln('} ');
writeln('</SCRIPT>');
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("albaranes",criterio,"rpt");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="l_albaran.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("albaranes",criterio,"rpt")
writeln('</FORM>');
}
writeln('<FORM NAME="l_albaran" method="Post" action="l_albaran.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM NAME="l_albaran" method="Post" action="l_albaran.html?waux='+request.waux+'&'+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
writeln("<B>Criterios de Seleccion Datos: </B>");
writeln("<HR>");
if (!request.nif)
request.nif="";
if (!request.d_cod_centro)
request.d_cod_centro="";
if (!request.h_cod_centro)
request.h_cod_centro="";
if (!request.razon_social)
request.razon_social="";
if (!request.d_nro_fra)
request.d_nro_fra="";
if (!request.h_nro_fra)
request.h_nro_fra="";
if (!request.f_desde)
request.f_desde="";
if (!request.f_hasta)
request.f_hasta="";
if (!request.d_nro_reg)
request.d_nro_reg="";
if (!request.h_nro_reg)
request.h_nro_reg="";
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TR><TD ALIGN=LEFT><B>Formato: </B></TD><TD><SELECT NAME="f_formato" SIZE=1>');
writeln('<OPTION VALUE="documento" SELECTED>Documento Registrado');
writeln('<OPTION VALUE="proveedor" >Por Proveedor');
writeln('<OPTION VALUE="centro" >Por Centro');
writeln('<OPTION VALUE="pendientes" >Pendientes de Factura');
writeln('<OPTION VALUE="emitidos" >Emitidos');
writeln('<OPTION VALUE="provBloq" >Retenidos');
writeln('</SELECT>');
writeln("<INPUT type='hidden' name='f_tipo' size=4 maxlength=4 VALUE='html' >");
writeln("<INPUT type='hidden' name='maxLins' size=2 maxlength=2 VALUE='76' >");
writeln('<TD ALIGN=LEFT><B>Borde: </B></TD><TD><SELECT NAME="borde" SIZE=1>');
writeln('<OPTION VALUE="0" SELECTED>No');
writeln('<OPTION VALUE="1" >Fino');
writeln('<OPTION VALUE="2" >Medio');
writeln('<OPTION VALUE="3" >Grueso');
writeln('</SELECT>');
writeln("</TD></TR>");
// writeln('<B>Tipo: </B><SELECT NAME="f_tipo" SIZE=1>');
// writeln('<OPTION VALUE="html" SELECTED>HTML');
// writeln('<OPTION VALUE="ascii" >ASCII');
// writeln('</SELECT></TD></TR>');
writeln('</TABLE>');
writeln("<HR>");
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Reg.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_reg" VALUE="'+request.d_nro_reg+'" OnChange="NroPad(this,5)" SIZE=5 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_reg" VALUE="'+request.h_nro_reg+'" OnChange="NroPad(this,5)" SIZE=5 ></TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Fra.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_fra" VALUE="'+request.d_nro_fra+'" SIZE=12 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_fra" VALUE="'+request.h_nro_fra+'" SIZE=12 > </TD>');
writeln("<TR><TD ALIGN=LEFT>N.I.F. .......: </TD><TD><INPUT type='text' name='nif' size=12 maxlength=12 VALUE='"+request.nif +"' onChange='this.value=this.value.toUpperCase()' > </TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Razón Social .: </TD><TD><INPUT type='text' name='razon_social' size=30 maxlength=40 VALUE='"+request.razon_social +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Código Centro Desde: </TD><TD><INPUT type='text' name='d_cod_centro' size=12 maxlength=12 VALUE='"+request.d_cod_centro +"' >");
writeln("Hasta: <INPUT type='text' name='h_cod_centro' size=12 maxlength=12 VALUE='"+request.h_cod_centro +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Emitido Desde: </TD><TD><INPUT type='text' name='f_desde' size=8 maxlength=10 VALUE='"+request.f_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='f_hasta' size=8 maxlength=10 VALUE='"+request.f_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"emision\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"emision\")' ></TD></TR>");
writeln('<TR><TD ALIGN=LEFT>Ordenado por: </TD><TD><SELECT NAME="f_orden" SIZE=1>');
writeln('<OPTION VALUE="razon_social" >Razón Social');
writeln('<OPTION VALUE="nif" >N.I.F.');
writeln('<OPTION VALUE="fra_reg" >Nro.Fra. ');
writeln('<OPTION VALUE="nro_reg" SELECTED>Nro.Reg. ');
writeln('<OPTION VALUE="fecha_emision" >Fecha Emisión');
writeln('<OPTION VALUE="cod_centro" >Centro ');
writeln('</SELECT></TD></TR></TABLE>');
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('</FORM>');
writeln("<CENTER>");
if (!request.waux) {
refHtml="l_albaran.html?"+baseHtml+"&search2=";
}
else {
refHtml="l_albaran.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
if (!request.waux)
writeSignature(true);
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

335
l_albaran.js Normal file
View File

@ -0,0 +1,335 @@
//////////////////////////////////////
// //
// JavaScript Functions //
// //
//////////////////////////////////////
function report_alb() {
var npag=0;
var nrolin=0;
while (c_albareg.next()) {
// if ( nrolin <= request.maxLins && npag >0 ) {
// skipTopPage(nrolin,request.maxLins);
// nrolin=0;
// }
// npag++;;
if (request.f_formato=="proveedor")
AlbProveedorHtml();
if (request.f_formato=="centro")
AlbCentroHtml();
if (request.f_formato=="pendientes")
AlbCentroHtml();
if (request.f_formato=="emitidos")
AlbEmitidosHtml();
if (request.f_formato=="provBloq")
AlbRetenidosHtml();
if (request.f_formato=="documento")
nrolin=AlbDocHtml(c_albareg.nro_reg);
}
}
function sumalbctas() {
CursorTabla("ac","nro_reg","=\'"+request.ab_nro_reg+"\'",false,"");
request.ac_totaldebe=0;
request.ac_totalhaber=0;
request.ac_total=0;
request.nroctas=0;
while (c_aptecuentas.next()) {
request.nroctas++;
if ( c_aptecuentas.tipo_apte == "D" )
request.ac_totaldebe=request.ac_totaldebe+c_aptecuentas.importe;
if ( c_aptecuentas.tipo_apte == "H" )
request.ac_totalhaber=request.ac_totalhaber+c_aptecuentas.importe;
}
request.ac_total=request.ac_totaldebe-request.ac_totalhaber;
c_aptecuentas.close()
}
function AlbProveedorHtml() {
var suma_total=0;
var suma_prov=0;
var nrolin=0;
var keyLastRow="-";
var is_newpag=true;
while (true) {
if ( nrolin+3 == request.maxLins ) {
fileRpt.writeln('<BR><BR><BR>');
nrolin=0;
is_newpag=true;
};
if ( keyLastRow != c_albareg.nif && keyLastRow !="-") {
fileRpt.writeln('</TABLE>');
fileRpt.writeln('<HR><TABLE BORDER='+request.borde+' ALIGN=CENTER><TR>');
fileRpt.writeln("<TR><TD ALIGN=RIGHT>TOTAL .... </TD>"+
"<TD ALIGN=RIGHT>"+NroFormat(suma_prov,NF11)+"</TD>");
fileRpt.writeln('</TABLE><HR>');
suma_prov=0;
nrolin=nrolin+3
set_head=true;
}
if ( is_newpag == true ) {
if ( keyLastRow !="-" ) { fileRpt.writeln('</TABLE>')};
fileRpt.writeln('<B><I>Dpto. Cuentas a Pagar</B></I><BR><HR>');
fileRpt.writeln('<ALIGN=LEFT><H3><B>LISTADO DE ALBARANES POR PROVEEDOR</B></H3>');
fileRpt.writeln('<HR>');
is_newpag=false;
nrolin=nrolin+4;
set_head=true;
}
if ( set_head == true ) {
fileRpt.writeln('<CENTER><TABLE BORDER=0 ALIGN=CENTER>');
fileRpt.writeln("<TR><TD ALIGN=RIGHT><B>"+c_albareg.nif +"</TD></B>"+
"<TD ALIGN=RIGHT><B>"+c_albareg.razon_social+"</TD></B>");
fileRpt.writeln('</TABLE>');
fileRpt.writeln('<HR><CENTER><TABLE BORDER='+request.borde+' ALIGN=CENTER>');
fileRpt.writeln(" <TR><TD ALIGN=CENTER>Nro. Reg." +
"<TD ALIGN=CENTER>F.Emisión </TD>"+
"<TD ALIGN=CENTER>Nro. Fra.</TD>"+
"<TD ALIGN=CENTER>Centro </TD>"+
"<TD ALIGN=CENTER>Importe</TD></TR>");
nrolin=nrolin+3; set_head=false;
}
request.ab_nro_reg=c_albareg.nro_reg;
sumalbctas();
fileRpt.writeln("<TR><TD ALIGN=RIGHT>"+c_albareg.nro_reg+"</TD>"+
"<TD ALIGN=RIGHT>"+datetoString(c_albareg.fecha_emision) +"</TD>"+
"<TD ALIGN=RIGHT>"+c_albareg.nro_fra +"</TD>"+
"<TD ALIGN=RIGHT>"+c_albareg.cod_centro +"</TD>"+
"<TD ALIGN=RIGHT>"+NroFormat(request.ac_total,NF11)+"</TD></TR>");
suma_total=suma_total+request.ac_total;
suma_prov=suma_prov+request.ac_total;
keyLastRow=c_albareg.nif;
nrolin++;
if (!c_albareg.next())
break;
}
// writeln("<TR><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD ALIGN=RIGHT></TD><TD ALIGN=RIGHT>----------------</TD>");
// writeln("<TR><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD ALIGN=RIGHT>Suma Total:</TD><TD ALIGN=RIGHT>"+NroFormat(suma_total,NF10) +"</TD>");
fileRpt.writeln('</TABLE>');
fileRpt.writeln('<TABLE BORDER=0 ALIGN=CENTER><TR>');
fileRpt.writeln("<TR><TD ALIGN=RIGHT>TOTAL .... </TD>"+
"<TD ALIGN=RIGHT>"+NroFormat(suma_prov,NF11)+"</TD>");
fileRpt.writeln('</TABLE>');
fileRpt.writeln('<HR><TABLE BORDER=0 ALIGN=CENTER><TR>');
fileRpt.writeln("<TR><TD ALIGN=RIGHT>TOTAL Acumulado....... </TD>"+
"<TD ALIGN=RIGHT>"+NroFormat(suma_total,NF11)+"</TD>");
fileRpt.writeln('</TABLE>');
}
function AlbCentroHtml() {
request.s_ctas=0;
request.s_total=0;
request.s_prov=0;
var nrolin=0;
var keyLastRow="-";
var desLastRow="";
var keyLastPrv="-";
var set_head=true;
var s_seq=getSeqPrt(nprinter);
textoReqs=textoReqs+" "+s_seq;
var nomFile=spoolpath+nprinter+"/req_"+s_seq+".html"
fileRpt=new File(nomFile);
fileRpt.open("w");
fileRpt.writeln('<HTML><HEAD></HEAD>');
fileRpt.writeln('<BASEFONT SIZE=2>');
status=database.execute("DELETE FROM sumactasalb where uid=\'" + request.uid+ "\'");
while (true) {
if ( nrolin+3 == request.maxLins ) {
fileRpt.writeln('<BR><BR><BR>');
nrolin=0;
set_head=true;
};
if ( keyLastPrv == "-" )
keyLastPrv=c_albareg.nif;
if ( keyLastPrv != c_albareg.nif ) {
keyLastPrv=c_albareg.nif;
fileRpt.writeln("<TR><TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><B><FONT SIZE=-1>TOTAL .... </FONT></B></TD>"+
"<TD></TD>"+
"<TD ALIGN=LEFT NOWRAP VALIGN=TOP ><B><FONT SIZE=-1>..............</FONT></B></TD>"+
"<TD ALIGN=LEFT NOWRAP VALIGN=TOP ><B><FONT SIZE=-1>..............</FONT></B></TD>"+
"<TD></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><B><FONT SIZE=-1>"+NroFormat(request.s_prov,NF9)+"</FONT></B></TD>"+
"<TD></TD>"+
"</TR>")
request.s_prov=0;
}
if ( keyLastRow != c_albareg.cod_centro && keyLastRow !="-" ) {
nrolin++;
fileRpt.writeln("<TR><TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><B><FONT SIZE=-1>TOTAL .... </FONT></B></TD>"+
"<TD></TD>"+
"<TD ALIGN=LEFT NOWRAP VALIGN=TOP ><B><FONT SIZE=-1>..............</FONT></B></TD>"+
"<TD ALIGN=LEFT NOWRAP VALIGN=TOP ><B><FONT SIZE=-1>..............</FONT></B></TD>"+
"<TD></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><B><FONT SIZE=-1>"+NroFormat(request.s_ctas,NF9)+"</FONT></B></TD>"+
"<TD></TD>"+
"</TR>")
fileRpt.writeln('</TABLE><BR><BR>');
AlbResCentrosHtml(keyLastRow,desLastRow);
fileRpt.writeln('</BODY>');
fileRpt.writeln('</HTML>');
fileRpt.close();
s_seq=getSeqPrt(nprinter);
textoReqs=textoReqs+" "+s_seq;
nomFile=spoolpath+nprinter+"/req_"+s_seq+".html"
fileRpt=new File(nomFile);
fileRpt.open("w");
fileRpt.writeln('<HTML><HEAD></HEAD>');
fileRpt.writeln('<BASEFONT SIZE=2>');
// if ( nrolin <= request.maxLins ) {
// skipTopPage(nrolin,request.maxLins);
// nrolin=0;
// set_head=true;
// }
request.s_ctas=0;
request.s_total=0;
request.s_prov=0;
nrolin=nrolin+3
set_head=true;
}
if ( set_head == true ) {
nrolin=nrolin+6;
if ( keyLastRow !="-" )
fileRpt.writeln("</TABLE>");
AlbCentrosCab();
set_head=false;
}
c_aptesalb = database.cursor("SELECT * from aptecuentas where nro_reg='"+
c_albareg.nro_reg+"' ")
if (c_aptesalb.next()) {
instCtaAlb();
if ( nrolin+1 > request.maxLins ) {
skipTopPage(nrolin,request.maxLins);
nrolin=6;
fileRpt.writeln("</TABLE>");
AlbCentrosCab();
}
nrolin++;
importe=parseFloat(c_aptesalb.importe);
if ( c_aptesalb.tipo_apte == "H" )
importe=parseFloat(c_aptesalb.importe)*-1;
request.s_prov=parseFloat(request.s_prov)+parseFloat(importe);
fileRpt.writeln("<TR><TD ALIGN=LEFT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+c_albareg.nro_reg+"</FONT></TD>"+
"<TD ALIGN=LEFT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+datetoString(c_albareg.fecha_emision) +"</FONT></TD>"+
"<TD ALIGN=LEFT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+c_albareg.nif+"</FONT></TD>"+
"<TD ALIGN=LEFT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+c_albareg.razon_social+"</FONT></TD>"+
"<TD ALIGN=LEFT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+c_aptesalb.cod_cta+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(importe,NF9)+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+c_albareg.fra_reg+"</FONT></TD>"+
"</TR>")
request.s_total=parseFloat(request.s_total)+parseFloat(importe);
request.s_ctas=parseFloat(request.s_ctas)+parseFloat(importe);
}
while (c_aptesalb.next()) {
instCtaAlb();
if ( nrolin+1 > request.maxLins ) {
skipTopPage(nrolin,request.maxLins);
nrolin=6;
fileRpt.writeln("</TABLE>");
AlbCentrosCab();
}
nrolin++;
importe=parseFloat(c_aptesalb.importe);
if ( c_aptesalb.tipo_apte == "H" )
importe=parseFloat(c_aptesalb.importe)*-1;
request.s_prov=parseFloat(request.s_prov)+parseFloat(importe);
fileRpt.writeln("<TR><TD ALIGN=RIGHT NOWRAP VALIGN=TOP ></TD>"+
"<TD></TD>"+
"<TD></TD>"+
"<TD></TD>"+
"<TD ALIGN=LEFT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+c_aptesalb.cod_cta+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(importe,NF9)+"</FONT></TD>"+
"<TD></TD>"+
"</TR>")
request.s_total=parseFloat(request.s_total)+parseFloat(importe);
request.s_ctas=parseFloat(request.s_ctas)+parseFloat(importe);
}
c_aptesalb.close();
keyLastRow=c_albareg.cod_centro;
desLastRow=c_albareg.descripcion;
if (!c_albareg.next())
break;
}
fileRpt.writeln("<TR><TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><B><FONT SIZE=-1>TOTAL .... </FONT></B></TD>"+
"<TD></TD>"+
"<TD ALIGN=LEFT NOWRAP VALIGN=TOP ><B><FONT SIZE=-1>..............</FONT></B></TD>"+
"<TD ALIGN=LEFT NOWRAP VALIGN=TOP ><B><FONT SIZE=-1>..............</FONT></B></TD>"+
"<TD></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><B><FONT SIZE=-1>"+NroFormat(request.s_ctas,NF9)+"</FONT></B></TD>"+
"<TD></TD>"+
"</TR>")
fileRpt.writeln('</TABLE>');
AlbResCentrosHtml(keyLastRow,desLastRow);
fileRpt.writeln('</BODY>');
fileRpt.writeln('</HTML>');
fileRpt.close();
}
function instCtaAlb() {
importe=parseFloat(c_aptesalb.importe);
if ( c_aptesalb.tipo_apte == "H" )
importe=parseFloat(c_aptesalb.importe)*-1;
status=database.execute("INSERT INTO sumactasalb(" +
" uid," +
" cod_centro," +
" cod_cta," +
" importe) VALUES ('" +
request.uid + "','" +
StringClip(true,c_albareg.cod_centro) + "','" +
StringClip(true,c_aptesalb.cod_cta) + "','" +
importe+ "')");
}
function AlbResCentrosHtml(clave,desclave) {
c_ctascentro = database.cursor("SELECT cod_cta,sum(importe) from sumactasalb where cod_centro=\'" +clave+"\' and uid=\'" + request.uid+
"\' group by cod_cta ");
fileRpt.writeln('<HR>');
if (request.f_formato=="pendientes")
fileRpt.writeln('<H4><B>RESUMEN CUENTAS DE ALBARANES PENDIENTES DE FACTURA</B></H4>');
else
fileRpt.writeln('<H4><B>RESUMEN DE CUENTAS POR CENTRO</B></H4>');
fileRpt.writeln('<HR>');
// fileRpt.writeln('<TABLE BORDER='+request.borde+' ALIGN=CENTER><TR>');
// fileRpt.writeln("<TD ALIGN=LEFT><B>"+clave +"</B>"+
// "<B>"+desclave+"</B>");
// fileRpt.writeln('</TD></TR></TABLE><BR><BR><LEFT>');
fileRpt.writeln("<FONT SIZE=+1>"+clave +desclave+"</FONT>");
fileRpt.writeln('<TABLE BORDER='+request.borde+' ALIGN=CENTER CELLSPACING=0 CELLPADDING=4 VALIGN="TOP"><TR>');
fileRpt.writeln("<TR><TH ALIGN=LEFT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Cod. Cta.</FONT></I></TH>" +
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Importe</FONT></I></TH>"+
"</TR>");
request.s_total=0;
while ( c_ctascentro.next()) {
fileRpt.writeln("<TR>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+c_ctascentro.cod_cta+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(c_ctascentro[1],NF11)+"</FONT></TD>"+
"</TR>");
request.s_total=parseFloat(request.s_total)+parseFloat(c_ctascentro[1]);
}
c_ctascentro.close();
fileRpt.writeln("<TR><TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>TOTAL</FONT></I></TH>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(request.s_total,NF11)+"</FONT></TH></TR>");
fileRpt.writeln('</TABLE>');
fileRpt.writeln('<BR><BR>');
}
function AlbCentrosCab() {
fileRpt.writeln('<H6><I>Dpto. Cuentas a Pagar</FONT></I>');
fileRpt.writeln('<HR>');
if (request.f_formato=="pendientes")
fileRpt.writeln('<ALIGN=CENTER><H4><B>LISTADO DE ALBARANES PENDIENTES DE FACTURA</B></H4>');
else
fileRpt.writeln('<ALIGN=CENTER><H4><B>LISTADO DE ALBARANES POR CENTRO</B></H4>');
fileRpt.writeln('<HR>');
fileRpt.writeln('</TABLE><ALIGN=LEFT>');
fileRpt.writeln("<ALIGN=LEFT NOWRAP VALIGN=TOP ><FONT SIZE=+1>"+c_albareg.cod_centro +c_albareg.descripcion+"</FONT>");
fileRpt.writeln('<TABLE BORDER='+request.borde+' ALIGN=CENTER CELLSPACING=0 CELLPADDING=4 VALIGN="TOP">');
fileRpt.writeln("<TR><TH ALIGN=CENTER NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Nro.Alb.</FONT></I></TH>" +
"<TH ALIGN=CENTER NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Fecha Al.</FONT></I></TH>"+
"<TH ALIGN=CENTER NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>N.I.F.</FONT></I></TH>"+
"<TH ALIGN=CENTER NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Razón Social</FONT></I></TH>"+
"<TH ALIGN=CENTER NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Cuenta</FONT></I></TH>"+
"<TH ALIGN=CENTER NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Imp.Cta.</FONT></I></TH>"+
"<TH ALIGN=CENTER NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Reg.Fra.</TH>"+
"</TR>");
}
function AlbPendientesHtml() {
}
function AlbEmitidosHtml() {
}
function AlbRetenidosHtml() {
}

945
l_docpago.js Normal file
View File

@ -0,0 +1,945 @@
//////////////////////////////////////
// //
// JavaScript Functions //
// //
//////////////////////////////////////
function wrdocpago(text){
// writeln("w_outdocpago.document.write('"+text+"\\n');");
fileRpt.writeln(text);
}
function chk_docspago() {
var query;
query = database.cursor("select count(*) FROM docspago WHERE uid=\'" + request.uid+ "\'");
if (query.next()) {
if (query[0] > 0) {
tdoc = database.cursor("select unique tipo_doc_pago FROM docspago WHERE uid=\'" + request.uid+ "\'");
tdoc.next();
if ( tdoc.tipo_doc_pago=="1" ) {
request.f_tipo_doc_pago="1";
Palabra="Pagarés";
}
if ( tdoc.tipo_doc_pago=="2" ) {
request.f_tipo_doc_pago="2";
Palabra="Talones";
}
writeln(' alert("\\r Hay '+Palabra+' Pendientes de Confirmación !!!"); ');
tdoc.close();
request.opt_docpago="true";
}
}
query.close();
if (request.opt_docpago)
return true
else
return false
}
function updPagoFras() {
client.is_trans=true;
database.beginTransaction();
c_docspago = database.cursor("SELECT * FROM docspago WHERE uid='"+request.uid+"' order by nro_reg ");
while (c_docspago.next()) {
// DesBloquear factura
status=database.execute("UPDATE facturas SET "+
" is_locked='N',"+
" tipo_doc_pago='" + c_docspago.tipo_doc_pago + "',"+
" nro_doc_pago='" + c_docspago.nro_doc_pago + "',"+
" f_emision_pago='" + DateFormat(datetoString(c_docspago.f_emision_pago),NLDF) + "',"+
" vto_pago='" + DateFormat(datetoString(c_docspago.vto_pago),NLDF) + "',"+
" cod_localidad='" + c_docspago.cod_localidad + "',"+
" cod_banco='" + c_docspago.cod_banco + "'"+
" WHERE nro_reg='"+c_docspago.nro_reg+"'");
if ( status != 0 ) {
c_docspago.close();
client.is_trans=false;
database.rollbackTransaction();
redirect(addClient('error.html?alert=9'));
}
}
database.commitTransaction();
client.is_trans=false;
c_docspago.close();
return true;
}
function report_docpago() {
// Borramos en tabla de pagos datos del usuario
status=database.execute("DELETE FROM docspago WHERE uid=\'" + request.uid+ "\'");
client.is_trans=true;
database.beginTransaction();
var s_lon=request.sel_nro_reg.length;
if (s_lon == 0 )
return;
var s_lon=request.sel_nro_reg.length;
var i=0;
pos=request.sel_nro_reg.substring(i,s_lon).indexOf("|")
var nregfra="";
while (pos >0) {
insertaDocPago(i,pos);
i=pos+1;
if ( i >= s_lon )
break;
pos=request.sel_nro_reg.substring(i,s_lon).indexOf("|")
if (pos <= 0 )
break;
else
pos=pos+i;
}
if (i==0)
return;
// Hay que buscar si tiene ABONOS
chk_abonos();
upd_docspago();
database.commitTransaction();
client.is_trans=false;
if (preparamat("spa", "f") == false ) // Aquí se prepara la trad. de dígitos
return;
if (request.f_tipo_doc_pago == "1" )
out_docpago()
if (request.f_tipo_doc_pago == "2" )
out_doctalon()
writeln('w_outdocpago=window.open("'+urlFile+'","w_outdocpago","toolbar=yes,directories=no,menubar=yes,status=no,scrollbars=yes,resizable=yes,width=600,height=500");');
}
function rpt_doccarta() {
out_doccarta()
writeln('w_carta=window.open("'+urlCarta+'","w_carta","toolbar=yes,directories=no,menubar=yes,status=no,scrollbars=yes,resizable=yes,width=600,height=500");');
}
function rpt_docfile() {
out_docfichero()
writeln('w_carta=window.open("'+urlFich+'","w_file","toolbar=yes,directories=no,menubar=yes,status=no,scrollbars=yes,resizable=yes,width=600,height=500");');
}
function insertaDocPago(i,pos) {
var nro_reg=request.sel_nro_reg.substring(i,pos);
// debug(nro_reg);
if ( nro_reg.length < 1 )
return;
c_facturas = database.cursor("SELECT nif, importe_total,cod_centro,f_pago,nro_fra,tipo_fra,tipo_doc_pago "+
" FROM facturas WHERE nro_reg="+nro_reg);
if (c_facturas.next()) {
status=database.execute("INSERT INTO docspago(" +
" uid," +
" nro_reg," +
" cod_centro," +
" f_pago," +
" nro_fra," +
" tipo_fra," +
" nif," +
" tipo_doc_pago," +
" nro_doc_pago," +
" f_emision_pago," +
" cod_localidad," +
" vto_pago," +
" cod_banco," +
" importe_total ) VALUES ('" + request.uid+ "','" +
nro_reg + "','"+
StringClip(true,c_facturas.cod_centro) + "','"+
DateFormat(datetoString(c_facturas.f_pago),NLDF) + "','"+
StringClip(true,c_facturas.nro_fra) + "','"+
StringClip(true,c_facturas.tipo_fra) + "','"+
StringClip(false,c_facturas.nif) + "','"+
StringClip(false,c_facturas.tipo_doc_pago) + "','"+
"0','"+
DateFormat(request.f_f_emision_pago,NLDF) + "','"+
StringClip(true,request.f_cod_localidad) + "','"+
DateFormat(datetoString(c_facturas.f_pago),NLDF) + "','"+
StringClip(true,request.f_cod_banco) + "','"+
c_facturas.importe_total + "')");
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect(addClient('error.html?alert=14&nro_reg='+nro_reg));
}
}
c_facturas.close();
}
function chk_abonos() {
// c_fraspago = database.cursor("SELECT sum(importe_total),nif FROM docspago WHERE uid='"+request.uid+"' group by nif ");
// while (c_fraspago.next()) {
// debug(c_fraspago[0]);
// if ( c_fraspago[0] < 0 ) {
// no se paga nada de nada ... nos Debe
// status=database.execute("DELETE from docspago WHERE uid='" + request.uid+"'"+
// " and nif = '"+c_fraspago.nif+"'");
// }
// }
// c_fraspago.close();
// Leemos los abonos de cada proveedor y buscamos fras. que lo cubran si no no se paga.
// Para evitar problemas actualizamos centro y f_pago en el abono ...
c_docsnif = database.cursor("SELECT UNIQUE nif FROM docspago WHERE uid='"+request.uid+"' ");
while (c_docsnif.next()) {
c_frasabono= database.cursor("SELECT * FROM docspago WHERE uid='"+request.uid+"' and nif ='"+c_docsnif.nif+"' and importe_total < 0 "+
" order by importe_total");
to_paynif=true;
while (c_frasabono.next() && to_paynif == true ) {
//debug(c_frasabono.nro_reg)
to_payfra=false;
c_fraspago = database.cursor("SELECT sum(importe_total),cod_centro,f_pago FROM docspago WHERE uid='"+request.uid+"' and nif ='"+c_docsnif.nif+"' and importe_total > 0 "+
"group by cod_centro,f_pago ");
while (c_fraspago.next() ) {
//linea=c_fraspago[0]+" "+c_frasabono.importe_total;
//debug(linea)
if ( c_fraspago[0] > c_frasabono.importe_total*-1 ) {
status=database.execute("UPDATE docspago SET cod_centro='"+c_fraspago.cod_centro+"',"+
" f_pago='"+DateFormat(datetoString(c_fraspago.f_pago),NLDF)+"',"+
" vto_pago='"+DateFormat(datetoString(c_fraspago.f_pago),NLDF)+
"' WHERE nro_reg='"+c_frasabono.nro_reg+"'");
to_payfra=true
break;
}
}
c_fraspago.close();
if ( to_payfra == false )
to_paynif=false;
}
if ( to_paynif == false ) {
status=database.execute("DELETE FROM docspago WHERE uid='" + request.uid+"'"+
" and nif = '"+c_docsnif.nif+"'");
}
c_frasabono.close();
}
c_docsnif.close();
}
function upd_docspago() {
var nro_docpago=parseFloat(NroUnformat(request.f_nro_doc));
var inro_docpago=nro_docpago;
// Actualizar las Filas con su nro_doc_pago ...
// c_docspago = database.cursor("SELECT * FROM docspago WHERE uid='"+request.uid+"' and importe_total > 0 order by nif,importe_total ");
c_docspago = database.cursor("SELECT * FROM docspago WHERE uid='"+request.uid+"' order by nif,importe_total ");
while (c_docspago.next()) {
// if (request.f_tipo_doc_pago=="1") // Pagaré
// if (request.f_tipo_doc_pago=="2") // Talón
// if (request.f_tipo_doc_pago=="3") // Compensación
// if (request.f_tipo_doc_pago=="4") // Domiciliación
// Asignar el nro. de documento de pago, el mismo si nif, centro y f_pago coinciden.
c_haydocspago = database.cursor("SELECT nro_doc_pago FROM docspago WHERE uid='"+ request.uid+"' and nif = '"+StringClip(false,c_docspago.nif)+
"' and nro_doc_pago !='0' and nro_reg != '"+c_docspago.nro_reg+
"' and cod_centro ='"+c_docspago.cod_centro+
"' and f_pago='"+DateFormat(datetoString(c_docspago.f_pago),NLDF)+"'");
// "' and importe_total > 0 "+
//debug(c_haydocspago.nro_doc_pago);
var nro_doc_pago=nro_docpago;
var hay_mas=false;
if ( c_haydocspago.next() ) {
nro_doc_pago=parseFloat(c_haydocspago.nro_doc_pago);
if ( nro_doc_pago == 0 )
nro_doc_pago=nro_docpago;
else
hay_mas=true;
}
c_haydocspago.close();
status=database.execute("UPDATE docspago SET nro_doc_pago='"+nro_doc_pago+"' WHERE nro_reg='"+c_docspago.nro_reg+"'");
if (hay_mas == false) { nro_docpago++ };
// Bloquear la factura durante el curso del pago ... Así sólo es de lectura.
status=database.execute("UPDATE facturas SET is_locked='S' WHERE nro_reg='"+c_docspago.nro_reg+"'");
}
c_docspago.close();
}
function no_sirve() {
// Devoluciones ...
c_docspago = database.cursor("SELECT * FROM docspago WHERE uid='"+request.uid+"' and importe_total < 0 order by nro_reg ");
while (c_docspago.next()) {
var nro=c_docspago.importe_total*-1;
// Asignar el nro. de documento de pago, el mismo si nif coincide.
c_haydocspago = database.cursor("SELECT nro_doc_pago FROM docspago WHERE uid='"+ request.uid+"' and nif = '"+StringClip(false,c_docspago.nif)+
"' and nro_doc_pago !='0' and nro_reg != '"+c_docspago.nro_reg+
"' and importe_total > '"+nro+"'");
if ( c_haydocspago.next() ) {
status=database.execute("UPDATE docspago SET nro_doc_pago='"+c_haydocspago.nro_doc_pago+"' WHERE nro_reg='"+c_docspago.nro_reg+"'");
// Bloquear la factura durante el curso del pago ... Así sólo es de lectura.
status=database.execute("UPDATE facturas SET is_locked='S' WHERE nro_reg='"+c_docspago.nro_reg+"'");
}
c_haydocspago.close();
}
c_docspago.close();
}
function cleanup_docspago() {
c_docspago = database.cursor("SELECT nro_reg FROM docspago WHERE uid='"+request.uid+"' order by nro_reg ");
while (c_docspago.next()) {
// DesBloquear factura
status=database.execute("UPDATE facturas SET is_locked='' WHERE nro_reg='"+c_docspago.nro_reg+"'");
}
// Borramos en tabla de pagos datos del usuario
status=database.execute("DELETE FROM docspago WHERE uid=\'" + request.uid+ "\'");
}
function out_docpago() {
var fileRpt=new File(nomFile);
fileRpt.open("w");
fileRpt.writeln('<HTML>');
fileRpt.writeln('<HEAD></HEAD>');
fileRpt.writeln('<BODY>');
fileRpt.writeln('<FONT SIZE=3>');
fileRpt.writeln('<PRE> ');
c_nrodocspago = database.cursor("SELECT UNIQUE nro_doc_pago FROM docspago WHERE uid="+ request.uid+" ORDER BY nro_doc_pago ");
var PlusNroDoc=0; // Acumula incrementos en Nro. Doc si salto página
var lnro="";
var nlin=1
while (c_nrodocspago.next()) {
c_docspago = database.cursor("SELECT importe_total FROM docspago WHERE uid="+ request.uid+
" and nro_doc_pago='"+c_nrodocspago.nro_doc_pago+"' ");
var importeTotal=0;
var NeedLins=0;
while (c_docspago.next()) { // A Sumar ....
importeTotal=importeTotal+parseFloat(c_docspago.importe_total);
NeedLins++;
}
c_docspago.close();
c_docspago = database.cursor("SELECT * FROM docspago WHERE uid="+ request.uid+
" and nro_doc_pago='"+c_nrodocspago.nro_doc_pago+"' ORDER BY importe_total ");
c_docspago.next();
CursorTabla("pr","nif","=\'"+StringClip(false,c_docspago.nif)+"\'",false,false);
CursorTabla("ba","cod_banco","=\'"+StringClip(false,c_docspago.cod_banco)+"\'",false,false);
if (request.t_nl == "1") { lnro=nlin; }
for (n=nlin; n<14 ; n++) {
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
}
fileRpt.writeln(lnro+" Málaga,"+datetoString(c_docspago.f_emision_pago));
nlin++;
// 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 23456789 123
// direccion=StringClip(false,c_proveedores.direccion_envio);
// localidad=StringClip(false,c_proveedores.cod_postal_envio)+" "+StringClip(false,c_proveedores.localidad_envio);
// if ( direccion == "" || direccion == " " ) {
direccion=StringClip(false,c_proveedores.domicilio);
localidad=StringClip(false,c_proveedores.cod_postal)+" "+c_proveedores.localidad;
// }
// attn_envio=StringClip(false,c_proveedores.attn_envio);
// fileRpt.writeln(lnro+" "+c_proveedores.attn_envio+" ");
if (request.t_nl == "1") { lnro=nlin };
fileRpt.writeln(lnro+" <B>"+StringClip(false,c_proveedores.razon_social)+"</B> ");
nlin++;
if (request.t_nl == "1") { lnro=nlin };
fileRpt.writeln(lnro+" "+direccion+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin };
fileRpt.writeln(lnro+" "+localidad+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin };
for (n=1; n<3 ; n++) {
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin };
}
if ( NeedLins > BodyLines) {
PlusNroDoc++;
}
var nro_doc_pago=parseFloat(c_docspago.nro_doc_pago)+PlusNroDoc;
if (PlusNroDoc > 0 ) {
status=database.execute("UPDATE docspago SET nro_doc_pago='"+nro_doc_pago+"' WHERE nro_reg='"+c_docspago.nro_reg+"'");
}
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" Muy Sres. nuestros:");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" Adjunto les remitimos pagaré nro. <I>0"+nro_doc_pago+"</I> a cargo del ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" <I>"+StringClip(false,c_bancos.nombre)+"</I> de pesetas <B><I>"+NroFormat(importeTotal,NF9)+"</I></B>,");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" con el cual cancelamos las facturas siguientes: ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" Centro Registro Importe Nro.Fra ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ------ --------- ---------------- ----------------");
nlin++;
blin=0;
if (request.t_nl == "1") { lnro=nlin; }
while (true) {
blin++;
codCentro=StringClip(false,c_docspago.cod_centro);
if ( c_docspago.importe_total < 0 )
codCentro=" ";
var nreg=c_docspago.nro_reg.substring(4,10)+"/"+c_docspago.nro_reg.substring(2,4);
fileRpt.writeln(lnro+" "+codCentro+" "+nreg+" "+NroFormat(c_docspago.importe_total,NF9)+" Ptas."+" "+StringClip(false,c_docspago.nro_fra));
if (blin+1 > BodyLines ) {
blin=0;
nlin=FootPosLin;
}
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
if ( nlin == FootPosLin ) {
for (var i=nlin ; i <= PaperLines ; i++) {
if (request.t_nl == "1") { lnro=i; }
fileRpt.writeln(lnro+" ");
}
for (var i=nlin ; i <= HeadPosLin ; i++) {
if (request.t_nl == "1") { lnro=i; }
fileRpt.writeln(lnro+" ");
}
nlin=HeadPosLin;
}
if ( !c_docspago.next())
break;
}
while ( blin < BodyLines ) {
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
blin++;
if (request.t_nl == "1") { lnro=nlin; }
}
fileRpt.writeln(lnro+" A la espera de que el mencionado importe sea de su entera ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" conformidad, reciban un cordial saludo.");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+"<I> CONSTRUCCIONES SANCHEZ DOMINGUEZ-SANDO, S.A.</I> ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
while (nlin < FootPosLin) {
// Salta hasta pie de Página
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
}
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
linea=NroFormat(importeTotal,NF9);
fileRpt.writeln(lnro+" <FONT SIZE=-1>");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" "+StringClip(false,c_proveedores.nif)+" "+StringClip(false,c_docspago.cod_localidad)+" #"+StringClip(true,linea)+"#");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" "+datetoString(c_docspago.f_emision_pago)+" "+datetoString(c_docspago.f_pago)+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
// fileRpt.writeln(lnro+" "+CompLetOn+"orden"+CompLetOff);
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" no a la orden");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
// 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 23456789 123
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" "+StringClip(false,c_proveedores.razon_social)+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
num_let="";
if (importeTotal > 0 )
nro_letra(importeTotal, "spa", "f", "PESETAS", CarPad,LongLine,LongLine);
//debug(num_let)
//debug(num_let2)
fileRpt.writeln(lnro+" "+num_let);
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" "+num_let2);
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
// fileRpt.writeln(lnro+" ");
// nlin++;
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" "+c_bancos.nombre+" "+c_bancos.entidad+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" "+c_bancos.domicilio+" "+c_bancos.sucursal+" "+c_bancos.cod_control+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" "+c_bancos.cod_postal+" "+c_bancos.localidad+" "+c_bancos.nro_cc+" </FONT>");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
while ( nlin <= PaperLines ) {
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
}
// Cerrando cursores
c_proveedores.close();
c_bancos.close();
c_docspago.close();
nlin=1;
}
c_nrodocspago.close();
fileRpt.writeln('<PRE>');
fileRpt.writeln('</FONT>');
fileRpt.writeln('</BODY>');
fileRpt.writeln('</HTML>');
fileRpt.close();
}
function out_doctalon() {
var fileRpt=new File(nomFile);
fileRpt.open("w");
fileRpt.writeln('<HTML>');
fileRpt.writeln('<HEAD></HEAD>');
fileRpt.writeln('<BODY>');
fileRpt.writeln('<FONT SIZE=2>');
fileRpt.writeln('<PRE> ');
c_nrodocspago = database.cursor("SELECT UNIQUE nro_doc_pago FROM docspago WHERE uid="+ request.uid+" ORDER BY nro_doc_pago ");
var f_pago = new Date();
var cadena=" ";
var loncad=cadena.length;
var nlin=1;
var lnro="";
while (c_nrodocspago.next()) {
c_docspago = database.cursor("SELECT importe_total FROM docspago WHERE uid="+ request.uid+
" and nro_doc_pago='"+c_nrodocspago.nro_doc_pago+"' ");
var importeTotal=0;
while (c_docspago.next()) { // A Sumar ....
importeTotal=importeTotal+parseFloat(c_docspago.importe_total);
}
c_docspago.close();
c_docspago = database.cursor("SELECT * FROM docspago WHERE uid="+ request.uid+
" and nro_doc_pago='"+c_nrodocspago.nro_doc_pago+"' ORDER BY nro_reg ");
c_docspago.next();
CursorTabla("pr","nif","=\'"+StringClip(false,c_docspago.nif)+"\'",false,false);
CursorTabla("ba","cod_banco","=\'"+StringClip(false,c_docspago.cod_banco)+"\'",false,false);
ntal=1;
if (request.t_nl == "1") { lnro=nlin; }
if ( nlin > 1 ) {
for (n=1; n<1 ; n++) {
fileRpt.writeln(nlin+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
}
}
if ( nlin == 1 )
ntal=3
// 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 23456789 123
if (request.t_nl == "1") { lnro=nlin; }
while (ntal < c_bancos.l_importe) {
fileRpt.writeln(lnro+" ");
nlin++; ntal++;
if (request.t_nl == "1") { lnro=nlin; }
}
linea=cadena;
nro=NroFormat(importeTotal,NF9);
linea=linea.substring(0,c_bancos.c_importe)+"#"+StringClip(true,nro)+"#";
fileRpt.writeln(linea);
nlin++; ntal++;
if (request.t_nl == "1") { lnro=nlin; }
while (ntal < c_bancos.l_paguese) {
fileRpt.writeln(lnro+" ");
nlin++; ntal++;
if (request.t_nl == "1") { lnro=nlin; }
}
linea=cadena;
linea=linea.substring(0,c_bancos.c_paguese)+StringClip(false,c_proveedores.razon_social);
fileRpt.writeln(linea);
nlin++; ntal++;
if (request.t_nl == "1") { lnro=nlin; }
while (ntal < c_bancos.l1_nroletra) {
fileRpt.writeln(lnro+" ");
nlin++; ntal++;
}
if (request.t_nl == "1") { lnro=nlin; }
num_let="";
if (importeTotal > 0 )
nro_letra(importeTotal, "spa", "f", "PESETAS", CarPad,LongLine,LongLine);
//debug(num_let)
//debug(num_let2)
linea=cadena;
linea=linea.substring(0,c_bancos.c1_nroletra)+num_let;
fileRpt.writeln(linea);
nlin++; ntal++;
if (request.t_nl == "1") { lnro=nlin; }
while (ntal < c_bancos.l2_nroletra) {
fileRpt.writeln(lnro+" ");
nlin++; ntal++;
}
if (request.t_nl == "1") { lnro=nlin; }
linea=cadena;
linea=linea.substring(0,c_bancos.c2_nroletra)+num_let2;
fileRpt.writeln(linea);
nlin++; ntal++;
if (request.t_nl == "1") { lnro=nlin; }
num_let="";
AsignaFecha(datetoString(c_docspago.f_pago),f_pago);
importeTotal=f_pago.getDate();
if (importeTotal > 0 )
nro_letra(importeTotal, "spa", "m", "", "",LongLine,LongLine);
if (request.t_nl == "1") { lnro=nlin; }
while (ntal < c_bancos.l_fecha) {
fileRpt.writeln(lnro+" ");
nlin++; ntal++;
if (request.t_nl == "1") { lnro=nlin; }
}
linea=cadena;
linea=linea.substring(0,c_bancos.c_fecha)+num_let;
lonlin=linea.length;
linea=linea+cadena.substring(lonlin,loncad);
linea=linea.substring(0,c_bancos.c_mes)+stringMonth(f_pago.getMonth()); //CalendarMonth();
linea=linea+cadena.substring(lonlin,loncad);
anno=""+f_pago.getYear();
linea=linea.substring(0,c_bancos.c_anno)+anno; //.substring(2,4)
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(linea);
nlin++; ntal++;
if (request.t_nl == "1") { lnro=nlin; }
while (ntal < c_bancos.l1_firmado) {
fileRpt.writeln(lnro+" ");
nlin++; ntal++;
if (request.t_nl == "1") { lnro=nlin; }
}
linea=cadena;
linea=linea.substring(0,c_bancos.c1_firmado)+StringClip(false,c_bancos.t1_firmado);
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(linea);
nlin++; ntal++;
if (request.t_nl == "1") { lnro=nlin; }
while (ntal < c_bancos.l2_firmado) {
fileRpt.writeln(lnro+" ");
nlin++; ntal++;
if (request.t_nl == "1") { lnro=nlin; }
}
linea=cadena;
linea=linea.substring(0,c_bancos.c2_firmado)+StringClip(false,c_bancos.t2_firmado);
fileRpt.writeln(linea);
nlin++; ntal++;
if (request.t_nl == "1") { lnro=nlin; }
while (ntal < c_bancos.nro_lins) {
fileRpt.writeln(lnro+" ");
nlin++; ntal++;
if (request.t_nl == "1") { lnro=nlin; }
}
// 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 23456789 123
if (nlin == PaperTLines )
nlin=1;
// Cerrando cursores
c_proveedores.close();
c_bancos.close();
c_docspago.close();
}
c_nrodocspago.close();
fileRpt.writeln('<PRE>');
fileRpt.writeln('</FONT>');
fileRpt.writeln('</BODY>');
fileRpt.writeln('</HTML>');
fileRpt.close();
}
function out_doccarta() {
var fileRpt=new File(nomCarta);
fileRpt.open("w");
fileRpt.writeln('<HTML>');
fileRpt.writeln('<HEAD></HEAD>');
fileRpt.writeln('<BODY>');
fileRpt.writeln('<FONT SIZE=3>');
fileRpt.writeln('<PRE> ');
c_nrodocspago = database.cursor("SELECT UNIQUE nro_doc_pago FROM docspago WHERE uid="+ request.uid+" ORDER BY nro_doc_pago ");
var PlusNroDoc=0; // Acumula incrementos en Nro. Doc si salto página
var lnro="";
while (c_nrodocspago.next()) {
c_docspago = database.cursor("SELECT importe_total FROM docspago WHERE uid="+ request.uid+
" and nro_doc_pago='"+c_nrodocspago.nro_doc_pago+"' ");
var importeTotal=0;
var NeedLins=0;
while (c_docspago.next()) { // A Sumar ....
importeTotal=importeTotal+parseFloat(c_docspago.importe_total);
NeedLins++;
}
c_docspago.close();
c_docspago = database.cursor("SELECT * FROM docspago WHERE uid="+ request.uid+
" and nro_doc_pago='"+c_nrodocspago.nro_doc_pago+"' ORDER BY nro_reg ");
c_docspago.next();
CursorTabla("pr","nif","=\'"+StringClip(false,c_docspago.nif)+"\'",false,false);
CursorTabla("ba","cod_banco","=\'"+StringClip(false,c_docspago.cod_banco)+"\'",false,false);
nlin=1;
if (request.t_nl == "1") { lnro=nlin; }
for (n=1; n<13 ; n++) {
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
}
fileRpt.writeln(lnro+" Málaga,"+datetoString(c_docspago.f_emision_pago));
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
// 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 23456789 123
// direccion=StringClip(false,c_proveedores.direccion_envio);
// localidad=StringClip(false,c_proveedores.cod_postal_envio)+" "+StringClip(false,c_proveedores.localidad_envio);
// if ( direccion == "" || direccion == " " ) {
direccion=StringClip(false,c_proveedores.domicilio);
localidad=StringClip(false,c_proveedores.cod_postal)+" "+c_proveedores.localidad;
// }
// attn_envio=StringClip(false,c_proveedores.attn_envio);
// fileRpt.writeln(lnro+" "+c_proveedores.attn_envio+" ");
fileRpt.writeln(lnro+" <B>"+StringClip(false,c_proveedores.razon_social)+"</B> ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" "+direccion+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" "+localidad+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
for (n=1; n<3 ; n++) {
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
}
if ( NeedLins > BodyLines) {
PlusNroDoc++;
}
var nro_doc_pago=parseFloat(c_docspago.nro_doc_pago)+PlusNroDoc;
if (PlusNroDoc > 0 ) {
status=database.execute("UPDATE docspago SET nro_doc_pago='"+nro_doc_pago+"' WHERE nro_reg='"+c_docspago.nro_reg+"'");
}
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" Muy Sres. nuestros:");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" Adjunto les remitimos talón nro. <B><I>"+nro_doc_pago+"</I></B> a cargo del ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" <I>"+StringClip(false,c_bancos.nombre)+"</I> de pesetas <B><I>"+NroFormat(importeTotal,NF9)+"</I></B>,");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" con el cual cancelamos las facturas siguientes: ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" Centro Registro Importe Nro.Fra ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ------ --------- ---------------- ----------------");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
blin=0;
while (true) {
blin++;
codCentro=StringClip(false,c_docspago.cod_centro);
if ( c_docspago.importe_total < 0 )
codCentro=" ";
var nreg=c_docspago.nro_reg.substring(4,10)+"/"+c_docspago.nro_reg.substring(2,4);
fileRpt.writeln(lnro+" "+codCentro+" "+nreg+" "+NroFormat(c_docspago.importe_total,NF9)+" Ptas."+" "+StringClip(false,c_docspago.nro_fra));
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
if ( nlin == FootPosLin ) {
for (var i=nlin ; i <= PaperLines ; i++) {
fileRpt.writeln(lnro+" ");
if (request.t_nl == "1") { lnro=nlin; }
}
for (var i=nlin ; i <= HeadPosLin ; i++) {
fileRpt.writeln(lnro+" ");
if (request.t_nl == "1") { lnro=nlin; }
}
nlin=HeadPosLin;
}
if ( !c_docspago.next())
break;
}
if (request.t_nl == "1") { lnro=nlin; }
while ( blin < BodyLines ) {
fileRpt.writeln(lnro+" ");
nlin++;
blin++;
if (request.t_nl == "1") { lnro=nlin; }
}
fileRpt.writeln(lnro+" A la espera de que el mencionado importe sea de su entera ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" conformidad, reciban un cordial saludo.");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
fileRpt.writeln(lnro+"<I> CONSTRUCCIONES SANCHEZ DOMINGUEZ-SANDO, S.A.</I> ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
while ( nlin <= PaperTray ) {
fileRpt.writeln(lnro+" ");
nlin++;
if (request.t_nl == "1") { lnro=nlin; }
}
// Cerrando cursores
c_proveedores.close();
c_bancos.close();
c_docspago.close();
}
c_nrodocspago.close();
fileRpt.writeln('<PRE>');
fileRpt.writeln('</FONT>');
fileRpt.writeln('</BODY>');
fileRpt.writeln('</HTML>');
fileRpt.close();
}
function out_docfichero() {
var fileRpt=new File(nomFich);
fileRpt.open("w");
c_nrodocspago = database.cursor("SELECT UNIQUE nro_doc_pago FROM docspago WHERE uid="+ request.uid+" ORDER BY nro_doc_pago ");
var PlusNroDoc=0; // Acumula incrementos en Nro. Doc si salto página
var lnro="";
while (c_nrodocspago.next()) {
c_docspago = database.cursor("SELECT importe_total FROM docspago WHERE uid="+ request.uid+
" and nro_doc_pago='"+c_nrodocspago.nro_doc_pago+"' ");
var importeTotal=0;
var NeedLins=0;
while (c_docspago.next()) { // A Sumar ....
importeTotal=importeTotal+parseFloat(c_docspago.importe_total);
NeedLins++;
}
c_docspago.close();
c_docspago = database.cursor("SELECT * FROM docspago WHERE uid="+ request.uid+
" and nro_doc_pago='"+c_nrodocspago.nro_doc_pago+"' ORDER BY nro_reg ");
c_docspago.next();
CursorTabla("pr","nif","=\'"+StringClip(false,c_docspago.nif)+"\'",false,false);
linea=" ";
linea=StringClip(false,c_proveedores.razon_social)+linea;
fileRpt.writeln(linea.substring(0,40)+" "+importeTotal);
// Cerrando cursores
c_proveedores.close();
c_docspago.close();
}
c_nrodocspago.close();
fileRpt.close();
}
function rpt_test() {
var fileRpt=new File(nomTest);
fileRpt.open("w");
fileRpt.writeln('<HTML>');
fileRpt.writeln('<HEAD></HEAD>');
fileRpt.writeln('<BODY>');
fileRpt.writeln('<FONT SIZE=3>');
fileRpt.writeln('<PRE> ');
var cadena="";
for (n=1; n< 8 ; n++) {
cadena=cadena+"123456789 "
}
fileRpt.writeln(cadena);
for (n=1; n< PaperLines ; n++) {
fileRpt.writeln(n);
}
fileRpt.writeln('<PRE>');
fileRpt.writeln('</FONT>');
fileRpt.writeln('</BODY>');
fileRpt.writeln('</HTML>');
fileRpt.close();
writeln('w_outtest=window.open("'+urlTest+'","w_test","toolbar=yes,directories=no,menubar=yes,status=no,scrollbars=yes,resizable=yes,width=600,height=500");');
}
function rpt_docpago() {
c_docspago= database.cursor("SELECT * FROM docspago WHERE uid='"+request.uid+"' order by nro_doc_pago ");
var fileRpt=new File(nomList);
fileRpt.open("w");
fileRpt.writeln('<HTML><HEAD></HEAD>');
fileRpt.writeln('<BODY BACKGROUND="images/backgrnd.gif">');
var suma_total=0;
var nlins=0;
var npag=1;
var is_newpag=true;
request.maxLins=53;
while (c_docspago.next()) {
CursorTabla("pr","nif","=\'"+StringClip(false,c_docspago.nif)+"\'",false,false);
CursorTabla("fa","nro_reg","=\'"+StringClip(false,c_docspago.nro_reg)+"\'",false,false);
// if ( nlins+3 == request.maxLins ) {
// fileRpt.writeln('<BR><BR><BR>');
// nlins=0;
// is_newpag=true;
// };
if ( is_newpag == true ) {
if (npag > 1 ) { fileRpt.write('</TABLE>')};
fileRpt.writeln('<B><I>Dpto. Cuentas a Pagar</B></I><BR><HR>');
fileRpt.writeln('<ALIGN=LEFT><H3><B>LISTADO DE PAGOS PENDIENTES DE CONFIRMAR</B></H3>');
fileRpt.writeln('<HR>');
is_newpag=false;
nlins=nlins+4;
set_head=true;
npag++;
}
if ( set_head == true ) {
fileRpt.writeln('<CENTER><TABLE BORDER=0 ALIGN=CENTER>');
fileRpt.writeln(" <TR><TD ALIGN=CENTER><B>N.Reg.</B>" +
"<TD ALIGN=CENTER><B>F.Vto.Pago</B> </TD>"+
"<TD ALIGN=CENTER><B>Centro </B></TD>"+
"<TD ALIGN=CENTER><B>Proveedor</B></TD>"+
"<TD ALIGN=CENTER><B>Tot.Fra.</B></TD>"+
"<TD ALIGN=CENTER><B>Nro.Doc.</B></TD>"+
"<TD ALIGN=CENTER><B>Banco</B></TD>"+
"<TD ALIGN=CENTER><B>Importe</B></TD></TR>");
nlins=nlins+2; set_head=false;
}
// "/" + c_docspago.nro_reg.substring(0,4) +"</TD>"+
fileRpt.writeln("<TR><TD ALIGN=RIGHT>"+c_docspago.nro_reg.substring(4,c_docspago.nro_reg.length) + "</TD>" +
"<TD ALIGN=RIGHT>"+datetoString(c_docspago.vto_pago) +"</TD>"+
"<TD ALIGN=CENTER>"+c_docspago.cod_centro +"</TD>"+
"<TD ALIGN=CENTER>"+c_proveedores.razon_social +"</TD>"+
"<TD ALIGN=RIGHT>"+NroFormat(c_facturas.importe_total,NF9)+"</TD>"+
"<TD ALIGN=CENTER>"+StringClip(false,c_docspago.nro_doc_pago) +"</TD>"+
"<TD ALIGN=CENTER>"+StringClip(false,c_docspago.cod_banco) +"</TD>"+
"<TD ALIGN=RIGHT>"+NroFormat(c_docspago.importe_total,NF9)+"</TD></TR>");
suma_total=suma_total+c_docspago.importe_total;
nlins++;
c_proveedores.close();
c_facturas.close();
}
// writeln("<TR><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD ALIGN=RIGHT></TD><TD ALIGN=RIGHT>----------------</TD>");
// writeln("<TR><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD ALIGN=RIGHT>Suma Total:</TD><TD ALIGN=RIGHT>"+NroFormat(suma_total,NF10) +"</TD>");
fileRpt.writeln('</TABLE>');
fileRpt.writeln('<HR><TABLE BORDER=0 ALIGN=CENTER><TR>');
fileRpt.writeln("<TR><TD></TD><TD ALIGN=RIGHT><B>TOTAL Acumulado....... </B></TD>"+
"<TD ALIGN=RIGHT><B>"+NroFormat(suma_total,NF11)+"</B></TD>");
fileRpt.writeln('</TABLE>');
fileRpt.writeln('</FONT>');
fileRpt.writeln('</BODY>');
fileRpt.writeln('</HTML>');
fileRpt.close();
writeln('w_outtest=window.open("'+urlList+'","w_list","toolbar=yes,directories=no,menubar=yes,status=no,scrollbars=yes,resizable=yes,width=600,height=500");');
}

419
l_factura.html Normal file
View File

@ -0,0 +1,419 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: l_factura.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>Listado de facturas</TITLE>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT SRC="l_factura.js">
</SCRIPT>
<SCRIPT SRC="factura.js">
</SCRIPT>
</HEAD>
<SERVER>
var NF6=""
var NF8=""
var NF9=""
var NF10=""
var HOY=new Date();
var nlin=0;
// Algunos formatos para fechas.
var NLDF=""; // para columnas en las queries INFORMIX
var nprinter="";
var spoolpath="";
var baseHtml="";
var textoReqs="";
var nomFile="c:/tmprpts/empty";
fileRpt=new File(nomFile);
fileRpt.close();
var PaperVLines=76// Nro. Lins. del Papel A4 Vertical FONT Default
var PaperHLines=52// Nro. Lins. del Papel A4 Horizontal FONT Default
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons();GoField()"');
else
writeln(' <BODY OnLoad="GoField()"');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln(' function GoField() {');
writeln(' var f=document.l_factura; ');
writeln('// alert("\\r¡¡¡ !!!"); ');
if (!request.f_orden)
writeln(' f.f_formato.focus();');
if (request.f_orden)
writeln("displayReport();");
writeln(' }');
writeln(' function chkYearNroReg(obj) {');
writeln(' var nro=parseInt(obj.value); ');
writeln(' if (nro+1 > 0 ) { ');
writeln(' obj.value=nro; ');
writeln(' if ( HOY.getFullYear() != nro ) ');
writeln(' alert("¡¡ El Año del Nro. de Registro no es el actual !! ");');
writeln(' }');
writeln(' }');
writeln('function NroPad(obj,longNro) {');
writeln(' if ( obj.value.length == 0 )');
writeln(' return;');
writeln(' if (obj.value.indexOf("*") >= 0) ');
writeln(' return;');
writeln(' c_nro=obj.value;');
writeln(' for (var j=c_nro.length ; j<longNro ; j++ ) {');
writeln(' c_nro="0"+c_nro;');
writeln(' }');
writeln(' obj.value=c_nro.substring(0,longNro);');
writeln('}');
if (request.gofunc) {
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_factura;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="l_factura.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
}
writeln('</SCRIPT>');
if( request.f_orden) {
if (!request.gofunc) {
dbConnect();
if (request.desde && request.hasta) {
var desde_fecha=DateFormat(request.desde,NLDF);
if ( desde_fecha.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
var hasta_fecha=DateFormat(request.hasta,NLDF);
if ( hasta_fecha.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
c_facturas = database.cursor("SELECT * FROM facturas,proveedores WHERE facturas.nif=proveedores.nif and "+ client.criteria +" Between '" +
desde_fecha + "' and '"+ hasta_fecha + "' ORDER BY " + client.criteria);
}
else if (request.search1) {
c_facturas = database.cursor("SELECT * FROM facturas,proveedores WHERE facturas.nif=proveedores.nif and "+ client.criteria +" MATCHES '" +
request.search1 + "' ORDER BY " + client.criteria);
}
else if (request.f_orden) {
var criterio=""
if ( request.f_desde.length > 0 ) {
var f_desde=DateFormat(request.f_desde,NLDF);
if ( f_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
criterio=" f_emision >= '"+f_desde+"' "
}
if ( request.f_hasta.length > 0 ) {
var f_hasta=DateFormat(request.f_hasta,NLDF);
if ( f_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" f_emision <= '"+f_hasta+"' "
}
if ( request.v_desde.length > 0 ) {
var v_desde=DateFormat(request.v_desde,NLDF);
if ( v_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago >= '"+v_desde+"' "
}
if ( request.v_hasta.length > 0 ) {
var v_hasta=DateFormat(request.v_hasta,NLDF);
if ( v_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago <= '"+v_hasta+"' "
}
if ( request.h_cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.cod_centro >= '"+request.d_cod_centro+"' and facturas.cod_centro <= '"+request.h_cod_centro+"' "
} else {
if ( request.d_cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.cod_centro matches '"+request.d_cod_centro+"'"
}
}
if ( request.nif.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nif matches '"+request.nif+"'"
}
if ( request.h_nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_fra >= '"+request.d_nro_fra+"' and facturas.nro_fra <= '"+request.h_nro_fra+"'"
} else {
if ( request.d_nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_fra matches '"+request.d_nro_fra+"'"
}
}
if ( request.h_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.mes >= '"+request.d_mes_fra+"' and facturas.mes <= '"+request.h_mes_fra+"'"
} else {
if ( request.d_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.mes = '"+request.d_mes_fra+"'"
}
}
if ( request.h_nro_regn.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_reg >= '"+StringClip(true,request.d_nro_regy)+StringClip(true,request.d_nro_regn)+"' and facturas.nro_reg <= '"+StringClip(true,request.h_nro_regy)+StringClip(true,request.h_nro_regn)+"'"
} else {
if ( request.d_nro_regn.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_reg matches '"+StringClip(true,request.d_nro_regy)+StringClip(true,request.d_nro_regn)+"'"
}
}
if ( request.razon_social.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
var razon_social=request.razon_social;
// var lowcaps = request.razon_social.toLowerCase();
// var uppercaps = request.razon_social.toUpperCase();
criterio=criterio+"razon_social matches '"+razon_social+"'"
}
if (request.f_formato=="proveedor")
request.f_orden=" facturas.nif,"+request.f_orden;
if (request.f_formato=="centro")
request.f_orden=" facturas.cod_centro,razon_social,"+request.f_orden;
if (request.f_formato=="pendientes")
request.f_orden=" facturas.f_recepcion,"+request.f_orden;
if (request.f_formato=="emitidas") {
request.f_orden=" facturas.cod_banco,facturas.vto_pago,"+request.f_orden;
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+"f_emision_pago is not null "
}
if (request.f_formato=="provBloq")
request.f_orden=" facturas.nif,"+request.f_orden;
// if (request.f_formato=="documento")
// request.f_orden=" facturas.nif,"+request.f_orden;
if (criterio.length > 0 )
criterio=" and "+criterio;
c_factreg = database.cursor("SELECT * FROM facturas,proveedores,centros WHERE facturas.nif=proveedores.nif and facturas.cod_centro=centros.cod_centro"+ criterio +
" ORDER BY " + request.f_orden);
}
if (!c_factreg)
DbsError(false,-1);
else {
report_fra();
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln("function displayReport() {");
if ( textoReqs.length > 0 )
writeln(' alert("Listado(s): '+textoReqs+'\\r está(n) en la cola \''+nprinter+'\'"); ');
writeln("}");
writeln("</SCRIPT>");
c_factreg.close();
}
}
}
criterio="Listado";
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RangoFecha(obj,clave) {');
writeln(' if (obj.value.length > 0 ){ ');
writeln(' if (clave == "emision") { ');
writeln(' if (dateCmp(obj.value,document.l_factura.f_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_factura.f_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "vto") { ');
writeln(' if (dateCmp(obj.value,document.l_factura.v_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_factura.v_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "fecha") { ');
writeln(' if (dateCmp(obj.value,document.l_factura.desde.value) != 1 ) {');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_factura.desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' } ');
writeln('} ');
writeln('function HastaDefault(obj,clave) {');
writeln(' if (obj.value.length <= 0 ){ ');
writeln(' if (clave == "emision") ');
writeln(' obj.value=document.l_factura.f_desde.value;');
writeln(' if (clave == "vto") ');
writeln(' obj.value=document.l_factura.v_desde.value;');
writeln(' if (clave == "fecha") ');
writeln(' obj.value=document.l_factura.desde.value;');
writeln(' } ');
writeln('} ');
writeln('</SCRIPT>');
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Facturas",criterio,"rpt");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="l_factura.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("Facturas",criterio,"rpt")
writeln('</FORM>');
}
writeln('<FORM NAME="l_factura" method="Post" action="l_factura.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM NAME="l_factura" method="Post" action="l_factura.html?waux='+request.waux+'&'+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
writeln("<B>Criterios de Seleccion Datos: </B>");
writeln("<HR>");
if (!request.nif)
request.nif="";
if (!request.d_cod_centro)
request.d_cod_centro="";
if (!request.h_cod_centro)
request.h_cod_centro="";
if (!request.razon_social)
request.razon_social="";
if (!request.d_nro_fra)
request.d_nro_fra="";
if (!request.h_nro_fra)
request.h_nro_fra="";
if (!request.d_mes_fra)
request.d_mes_fra="";
if (!request.h_mes_fra)
request.h_mes_fra="";
if (!request.f_desde)
request.f_desde="";
if (!request.f_hasta)
request.f_hasta="";
if (!request.v_desde)
request.v_desde="";
if (!request.v_hasta)
request.v_hasta="";
if (!request.d_nro_regn)
request.d_nro_regn="";
if (!request.d_nro_regy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.d_nro_regy=n;
}
if (!request.h_nro_regn)
request.h_nro_regn="";
if (!request.h_nro_regy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.h_nro_regy=n;
}
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TR><TD ALIGN=LEFT><B>Formato: </B></TD><TD><SELECT NAME="f_formato" SIZE=1>');
writeln('<OPTION VALUE="documento" SELECTED>Documento Registrado');
writeln('<OPTION VALUE="proveedor" >Por Proveedor');
writeln('<OPTION VALUE="centro" >Por Centro');
writeln('<OPTION VALUE="pendientes" >Pendientes de Pago');
writeln('<OPTION VALUE="emitidas" >Emitidas');
writeln('<OPTION VALUE="provBloq" >Retenidas');
writeln('</SELECT>');
writeln("<INPUT type='hidden' name='f_tipo' size=4 maxlength=4 VALUE='html' >");
writeln("<INPUT type='hidden' name='maxLins' size=2 maxlength=2 VALUE='76' >");
writeln('<TD ALIGN=LEFT><B>Borde: </B></TD><TD><SELECT NAME="borde" SIZE=1>');
writeln('<OPTION VALUE="0" SELECTED>No');
writeln('<OPTION VALUE="1" >Fino');
writeln('<OPTION VALUE="2" >Medio');
writeln('<OPTION VALUE="3" >Grueso');
writeln('</SELECT>');
writeln("</TD></TR>");
// writeln('<B>Tipo: </B><SELECT NAME="f_tipo" SIZE=1>');
// writeln('<OPTION VALUE="html" SELECTED>HTML');
// writeln('<OPTION VALUE="ascii" >ASCII');
// writeln('</SELECT></TD></TR>');
writeln('</TABLE>');
writeln("<HR>");
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Reg.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_regn" VALUE="'+request.d_nro_regn+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="d_nro_regy" VALUE="'+request.d_nro_regy+'" SIZE=4 OnChange="chkYearNroReg(this)">');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_regn" VALUE="'+request.h_nro_regn+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="h_nro_regy" VALUE="'+request.h_nro_regy+'" SIZE=4 OnChange="chkYearNroReg(this)"><INPUT TYPE="submit" value=" / "></TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Fra.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_fra" VALUE="'+request.d_nro_fra+'" SIZE=12 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_fra" VALUE="'+request.h_nro_fra+'" SIZE=12 > </TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Mes.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_mes_fra" VALUE="'+request.d_mes_fra+'" SIZE=2 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_mes_fra" VALUE="'+request.h_mes_fra+'" SIZE=2 > </TD>');
writeln("<TR><TD ALIGN=LEFT>N.I.F. .......: </TD><TD><INPUT type='text' name='nif' size=12 maxlength=12 VALUE='"+request.nif +"' onChange='this.value=this.value.toUpperCase()' > </TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Razón Social .: </TD><TD><INPUT type='text' name='razon_social' size=30 maxlength=40 VALUE='"+request.razon_social +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Código Centro Desde: </TD><TD><INPUT type='text' name='d_cod_centro' size=12 maxlength=12 VALUE='"+request.d_cod_centro +"' >");
writeln("Hasta: <INPUT type='text' name='h_cod_centro' size=12 maxlength=12 VALUE='"+request.h_cod_centro +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Emitida Desde: </TD><TD><INPUT type='text' name='f_desde' size=8 maxlength=10 VALUE='"+request.f_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='f_hasta' size=8 maxlength=10 VALUE='"+request.f_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"emision\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"emision\")' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Vto. Pago Desde: </TD><TD><INPUT type='text' name='v_desde' size=8 maxlength=10 VALUE='"+request.v_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='v_hasta' size=8 maxlength=10 VALUE='"+request.v_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"vto\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"vto\")''></TD></TR>");
writeln('<TR><TD ALIGN=LEFT>Ordenado por: </TD><TD><SELECT NAME="f_orden" SIZE=1>');
writeln('<OPTION VALUE="razon_social" >Razón Social');
writeln('<OPTION VALUE="nif" >N.I.F.');
writeln('<OPTION VALUE="nro_fra" >Nro.Fra. ');
writeln('<OPTION VALUE="nro_reg" SELECTED>Nro.Reg. ');
writeln('<OPTION VALUE="f_emision" >Fecha Emisión');
writeln('<OPTION VALUE="vto_pago" >Vto. Pago');
writeln('<OPTION VALUE="cod_centro" >Centro ');
writeln('<OPTION VALUE="f_emision" >Fecha Pago ');
writeln('<OPTION VALUE="vto_pago" >Vto. Pago ');
writeln('</SELECT></TD></TR></TABLE>');
writeln('<INPUT TYPE="submit" value="Buscar">');
if (!request.waux) {
refHtml="l_factura.html?"+baseHtml+"&search2=";
}
else {
refHtml="l_factura.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
writeln('</FORM>');
writeln("<CENTER>");
if (!request.waux)
writeSignature(true);
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

477
l_factura.js Normal file
View File

@ -0,0 +1,477 @@
//////////////////////////////////////
// //
// JavaScript Functions //
// //
//////////////////////////////////////
function report_fra() {
var npag=0;
var nrolin=0;
while (c_factreg.next()) {
// if ( nrolin <= request.maxLins && npag >0 ) {
// skipTopPage(nrolin,request.maxLins);
// nrolin=0;
// }
// npag++;;
if (request.f_formato=="proveedor")
FraProveedorHtml();
if (request.f_formato=="centro")
FraCentroHtml();
if (request.f_formato=="pendientes")
FraPendientesHtml();
if (request.f_formato=="emitidas")
FraEmitidasHtml();
if (request.f_formato=="provBloq")
FraRetenidasHtml();
if (request.f_formato=="documento")
nrolin=FraDocHtml(c_factreg.nro_reg);
}
}
function FraProveedorHtml() {
var suma_total=0;
var suma_prov=0;
var nrolin=0;
var keyLastRow="-";
var is_newpag=true;
while (true) {
if ( nrolin+3 == request.maxLins ) {
fileRpt.writeln('<BR><BR><BR>');
nrolin=0;
is_newpag=true;
};
if ( keyLastRow != c_factreg.nif && keyLastRow !="-") {
fileRpt.writeln('</TABLE>');
fileRpt.writeln('<HR><TABLE BORDER='+request.borde+' ALIGN=CENTER><TR>');
fileRpt.writeln("<TR><TD ALIGN=RIGHT>TOTAL .... </TD>"+
"<TD ALIGN=RIGHT>"+NroFormat(suma_prov,NF11)+"</TD>");
fileRpt.writeln('</TABLE><HR>');
suma_prov=0;
nrolin=nrolin+3
set_head=true;
}
if ( is_newpag == true ) {
if ( keyLastRow !="-" ) { fileRpt.writeln('</TABLE>')};
fileRpt.writeln('<B><I>Dpto. Cuentas a Pagar</B></I><BR><HR>');
fileRpt.writeln('<ALIGN=LEFT><H3><B>LISTADO DE FACTURAS POR PROVEEDOR</B></H3>');
fileRpt.writeln('<HR>');
is_newpag=false;
nrolin=nrolin+4;
set_head=true;
}
if ( set_head == true ) {
fileRpt.writeln('<CENTER><TABLE BORDER=0 ALIGN=CENTER>');
fileRpt.writeln("<TR><TD ALIGN=RIGHT><B>"+c_factreg.nif +"</TD></B>"+
"<TD ALIGN=RIGHT><B>"+c_factreg.razon_social+"</TD></B>");
fileRpt.writeln('</TABLE>');
fileRpt.writeln('<HR><CENTER><TABLE BORDER='+request.borde+' ALIGN=CENTER>');
fileRpt.writeln(" <TR><TD ALIGN=CENTER>Nro. Reg." +
"<TD ALIGN=CENTER>F.Emisión </TD>"+
"<TD ALIGN=CENTER>Nro. Fra.</TD>"+
"<TD ALIGN=CENTER>Centro </TD>"+
"<TD ALIGN=CENTER>Vto. Pago</TD>"+
"<TD ALIGN=CENTER>Importe</TD></TR>");
nrolin=nrolin+3; set_head=false;
}
fileRpt.writeln("<TR><TD ALIGN=RIGHT>"+c_factreg.nro_reg.substring(4,c_factreg.nro_reg.length) + "/" +
c_factreg.nro_reg.substring(0,4) +"</TD>"+
"<TD ALIGN=RIGHT>"+datetoString(c_factreg.f_emision) +"</TD>"+
"<TD ALIGN=RIGHT>"+c_factreg.nro_fra +"</TD>"+
"<TD ALIGN=RIGHT>"+c_factreg.cod_centro +"</TD>"+
"<TD ALIGN=RIGHT>"+datetoString(c_factreg.vto_pago) +"</TD>"+
"<TD ALIGN=RIGHT>"+NroFormat(c_factreg.importe_total,NF9)+"</TD></TR>");
suma_total=suma_total+c_factreg.importe_total;
suma_prov=suma_prov+c_factreg.importe_total;
keyLastRow=c_factreg.nif;
nrolin++;
if (!c_factreg.next())
break;
}
// writeln("<TR><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD ALIGN=RIGHT></TD><TD ALIGN=RIGHT>----------------</TD>");
// writeln("<TR><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD ALIGN=RIGHT>Suma Total:</TD><TD ALIGN=RIGHT>"+NroFormat(suma_total,NF10) +"</TD>");
fileRpt.writeln('</TABLE>');
fileRpt.writeln('<TABLE BORDER=0 ALIGN=CENTER><TR>');
fileRpt.writeln("<TR><TD ALIGN=RIGHT>TOTAL .... </TD>"+
"<TD ALIGN=RIGHT>"+NroFormat(suma_prov,NF11)+"</TD>");
fileRpt.writeln('</TABLE>');
fileRpt.writeln('<HR><TABLE BORDER=0 ALIGN=CENTER><TR>');
fileRpt.writeln("<TR><TD ALIGN=RIGHT>TOTAL Acumulado....... </TD>"+
"<TD ALIGN=RIGHT>"+NroFormat(suma_total,NF11)+"</TD>");
fileRpt.writeln('</TABLE>');
}
function FraCentroHtml() {
request.s_iva=0;
request.s_ctas=0;
request.s_ret=0;
request.s_total=0;
request.s_prov=0;
request.s_albs=0;
var nrolin=0;
var keyLastRow="-";
var desLastRow="";
var keyLastPrv="";
var set_head=true;
var s_seq=getSeqPrt(nprinter);
textoReqs=textoReqs+" "+s_seq;
var nomFile=spoolpath+nprinter+"/req_"+s_seq+".html"
fileRpt=new File(nomFile);
fileRpt.open("w");
fileRpt.writeln('<HTML><HEAD></HEAD>');
fileRpt.writeln('<BASEFONT SIZE=2>');
status=database.execute("DELETE FROM sumactasfra where uid=\'" + request.uid+ "\'");
while (true){
if ( nrolin+3 == request.maxLins ) {
fileRpt.writeln('<BR><BR><BR>');
nrolin=0;
set_head=true;
};
if ( keyLastPrv != c_factreg.nif ) {
keyLastPrv=c_factreg.nif;
s_prov=0;
}
if ( keyLastRow != c_factreg.cod_centro && keyLastRow !="-" ) {
nrolin++;
fileRpt.writeln("<TR><TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>TOTAL .... </FONT></TH>"+
// "<TH ALIGN=RIGHT>"+NroFormat(suma_ctas,NF11)+"</TH>");
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TH ALIGN=RIGHT><B>"+NroFormat(request.s_ctas,NF11)+"</FONT></TH>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(request.s_ret,NF11)+"</FONT></TH>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(request.s_iva,NF11)+"</FONT></TH>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(request.s_total,NF11)+"</FONT></TH>"+
"<TD ALIGN=RIGHT></TD>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(request.s_albs,NF11)+"</FONT></TH>"+
"<TD ALIGN=RIGHT></TD>"+
"</TR>");
fileRpt.writeln('</TABLE><BR><BR>');
FraResCentrosHtml(keyLastRow,desLastRow);
fileRpt.writeln('</BODY>');
fileRpt.writeln('</HTML>');
fileRpt.close();
s_seq=getSeqPrt(nprinter);
textoReqs=textoReqs+" "+s_seq;
nomFile=spoolpath+nprinter+"/req_"+s_seq+".html"
fileRpt=new File(nomFile);
fileRpt.open("w");
fileRpt.writeln('<HTML><HEAD></HEAD>');
fileRpt.writeln('<BASEFONT SIZE=2>');
// if ( nrolin <= request.maxLins ) {
// skipTopPage(nrolin,request.maxLins);
// nrolin=0;
// set_head=true;
// }
request.s_iva=0;
request.s_ctas=0;
request.s_ret=0;
request.s_total=0;
request.s_prov=0;
request.s_albs=0;
nrolin=nrolin+3
set_head=true;
}
if ( set_head == true ) {
nrolin=nrolin+6;
if ( keyLastRow !="-" )
fileRpt.writeln("</TABLE>");
FraCentrosCab();
set_head=false;
}
s_iva=c_factreg.iva_1+c_factreg.iva_2+c_factreg.iva_3;
s_ret=c_factreg.ret_1+c_factreg.ret_2+c_factreg.ret_3;
// request.s_prov=request.s_prov+c_factreg.importe_total;
c_aptesfra = database.cursor("SELECT * from aptectasfra where nro_reg='"+
c_factreg.nro_reg+"' and nro_lin > 9 ")
c_albafra = database.cursor("SELECT * from albafras where nroreg_factura='"+
c_factreg.nro_reg+"' order by nroreg_albafact ")
if (c_aptesfra.next()) {
insCtaFra();
if (c_albafra.next()) {
a_nroreg=c_albafra.nroreg_albaran;
a_sumactas=NroFormat(c_albafra.sumactas,NF9)
request.s_albs=parseFloat(request.s_albs)+parseFloat(c_albafra.sumactas);
}
else {
a_nroreg="";
a_sumactas="";
}
importe=parseFloat(c_aptesfra.importe);
if ( c_aptesfra.tipo_apte == "H" )
importe=parseFloat(c_aptesfra.importe)*-1;
if ( nrolin+1 > request.maxLins ) {
skipTopPage(nrolin,request.maxLins);
nrolin=6;
fileRpt.writeln("</TABLE>");
FraCentrosCab();
}
nrolin++;
fileRpt.writeln("<TR><TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+c_factreg.nro_reg.substring(4,c_factreg.nro_reg.length) +
// "/" + c_factreg.nro_reg.substring(0,4) +
"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+c_factreg.nro_fra +"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+datetoString(c_factreg.f_emision) +"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+datetoString(c_factreg.f_recepcion) +"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+datetoString(c_factreg.vto_pago) +"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+c_factreg.tipo_doc_pago+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+datetoString(c_factreg.f_emision_pago) +"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+c_aptesfra.cod_cta+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(importe,NF9)+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(s_ret,NF9)+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(s_iva,NF9)+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(c_factreg.importe_total,NF9)+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+a_nroreg+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+a_sumactas+"</FONT></TD>"+
"<TD ALIGN=LEFT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+c_factreg.razon_social+"</FONT></TD>"+
// "<TD ALIGN=LEFT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+c_factreg.razon_social.substring(0,18)+"</FONT></TD>"+
"</TR>")
request.s_total=parseFloat(request.s_total)+parseFloat(c_factreg.importe_total);
request.s_ret=parseFloat(request.s_ret)+parseFloat(s_ret);
request.s_iva=parseFloat(request.s_iva)+parseFloat(s_iva);
request.s_ctas=parseFloat(request.s_ctas)+parseFloat(importe);
}
while (c_aptesfra.next()) {
insCtaFra();
if (c_albafra.next()) {
a_nroreg=c_albafra.nroreg_albaran;
a_sumactas=NroFormat(c_albafra.sumactas,NF9)
request.s_albs=parseFloat(request.s_albs)+parseFloat(c_albafra.sumactas);
}
else {
a_nroreg="";
a_sumactas="";
}
importe=parseFloat(c_aptesfra.importe);
if ( c_aptesfra.tipo_apte == "H" )
importe=parseFloat(c_aptesfra.importe)*-1;
if ( nrolin+1 > request.maxLins ) {
skipTopPage(nrolin,request.maxLins);
nrolin=6;
fileRpt.writeln("</TABLE>");
FraCentrosCab();
}
nrolin++;
fileRpt.writeln("<TR><TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+c_aptesfra.cod_cta+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(importe,NF9)+"</FONT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+a_nroreg+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+a_sumactas+"</FONT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"</TR>");
request.s_ctas=parseFloat(request.s_ctas)+parseFloat(importe);
}
c_aptesfra.close();
while (c_albafra.next()) {
if ( nrolin+1 > request.maxLins ) {
skipTopPage(nrolin,request.maxLins);
nrolin=6;
fileRpt.writeln("</TABLE>");
FraCentrosCab();
}
nrolin++;
fileRpt.writeln("<TR><TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+c_albafra.nroreg_albaran+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(c_albafra.sumactas,NF9)+"</FONT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"</TR>");
request.s_albs=parseFloat(request.s_albs)+parseFloat(c_albafra.sumactas);
}
keyLastRow=c_factreg.cod_centro;
desLastRow=c_factreg.descripcion;
c_albafra.close();
if (!c_factreg.next())
break;
}
fileRpt.writeln("<TR><TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>TOTAL .... </FONT></TD>"+
// "<TD ALIGN=RIGHT>"+NroFormat(suma_ctas,NF11)+"</TD>");
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(request.s_ctas,NF11)+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(request.s_ret,NF11)+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(request.s_iva,NF11)+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(request.s_total,NF11)+"</FONT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(request.s_albs,NF11)+"</FONT></TD>"+
"<TD ALIGN=RIGHT></TD>"+
"</TR>");
fileRpt.writeln('</TABLE>');
FraResCentrosHtml(keyLastRow,desLastRow);
fileRpt.writeln('</BODY>');
fileRpt.writeln('</HTML>');
fileRpt.close();
}
function insCtaFra() {
importe=parseFloat(c_aptesfra.importe);
if ( c_aptesfra.tipo_apte == "H" )
importe=parseFloat(c_aptesfra.importe)*-1;
status=database.execute("INSERT INTO sumactasfra(" +
" uid," +
" cod_centro," +
" cod_cta," +
" importe) VALUES ('" +
request.uid + "','" +
StringClip(true,c_factreg.cod_centro) + "','" +
StringClip(true,c_aptesfra.cod_cta) + "','" +
importe+ "')");
}
function FraResCentrosHtml(clave,desclave) {
c_ctascentro = database.cursor("SELECT cod_cta,sum(importe) from sumactasfra where cod_centro=\'" +clave+"\' and uid=\'" + request.uid+
"\' group by cod_cta ");
fileRpt.writeln('<HR>');
fileRpt.writeln('<H4><B>RESUMEN DE CUENTAS POR CENTRO</B></H4>');
fileRpt.writeln('<HR>');
// fileRpt.writeln('<TABLE BORDER='+request.borde+' ALIGN=CENTER><TR>');
// fileRpt.writeln("<TD ALIGN=LEFT><B>"+clave +"</B>"+
// "<B>"+desclave+"</B>");
// fileRpt.writeln('</TD></TR></TABLE><BR><BR><LEFT>');
fileRpt.writeln("<FONT SIZE=+1>"+clave +desclave+"</FONT>");
fileRpt.writeln('<TABLE BORDER='+request.borde+' ALIGN=CENTER CELLSPACING=0 CELLPADDING=4 VALIGN="TOP"><TR>');
fileRpt.writeln("<TR><TH ALIGN=LEFT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Cod. Cta.</FONT></I></TH>" +
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Importe</FONT></I></TH>"+
"</TR>");
request.s_total=0;
while ( c_ctascentro.next()) {
fileRpt.writeln("<TR>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+c_ctascentro.cod_cta+"</FONT></TD>"+
"<TD ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(c_ctascentro[1],NF11)+"</FONT></TD>"+
"</TR>");
request.s_total=parseFloat(request.s_total)+parseFloat(c_ctascentro[1]);
}
c_ctascentro.close();
fileRpt.writeln("<TR><TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>TOTAL</FONT></I></TH>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1>"+NroFormat(request.s_total,NF11)+"</FONT></TH></TR>");
fileRpt.writeln('</TABLE>');
fileRpt.writeln('<BR><BR>');
}
function FraCentrosCab() {
fileRpt.writeln('<H6><I>Dpto. Cuentas a Pagar</FONT></I>');
fileRpt.writeln('<HR>');
fileRpt.writeln('<ALIGN=CENTER><H4><B>LISTADO DE FACTURAS POR CENTRO</B></H4>');
fileRpt.writeln('<HR>');
fileRpt.writeln('</TABLE><ALIGN=LEFT>');
fileRpt.writeln("<ALIGN=LEFT NOWRAP VALIGN=TOP ><FONT SIZE=+1>"+c_factreg.cod_centro +c_factreg.descripcion+"</FONT>");
fileRpt.writeln('<TABLE BORDER='+request.borde+' ALIGN=CENTER CELLSPACING=0 CELLPADDING=4 VALIGN="TOP">');
fileRpt.writeln("<TR><TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Nro.Reg.</FONT></I></TH>" +
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Nro. Fra.</FONT></I></TH>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>F.Fra.</FONT></I></TH>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>F.Recep.</FONT></I></TH>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>F.Pago</FONT></I></TH>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>TD</FONT></I></TH>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>F.Emis.</FONT></I></TH>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Cuenta</FONT></I></TH>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Imp.Cta.</FONT></I></TH>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Retención</FONT></I></TH>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>I.V.A.</FONT></I></TH>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Total Fra.</FONT></I></TH>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Alb.Int.</FONT></I></TH>"+
"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Alb.Imp.</FONT></I></TH>"+
"<TH ALIGN=CENTER NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Razón Social</FONT></I></TH>"+
// "<TH ALIGN=CENTER NOWRAP VALIGN=TOP ><FONT SIZE=-1><I>Imp.Prov.</TH>"+
"</TR>");
}
function FraPendientesHtml() {
}
function FraEmitidasHtml() {
var suma_total=0;
var suma_banco=0;
var nrolin=0;
var npag=1;
var keyLastRow="";
var is_newpag=true;
while (true) {
if ( nrolin+3 == request.maxLins ) {
fileRpt.writeln('<BR><BR><BR>');
nrolin=0;
is_newpag=true;
};
if ( keyLastRow != c_factreg.nif && npag!=1 ) {
fileRpt.writeln('</TABLE>');
fileRpt.writeln('<HR><TABLE BORDER=0 ALIGN=CENTER><TR>');
fileRpt.writeln("<TR><TD ALIGN=RIGHT>TOTAL .... </TD>"+
"<TD ALIGN=RIGHT>"+NroFormat(suma_banco,NF11)+"</TD>");
fileRpt.writeln('</TABLE><HR>');
suma_banco=0;
nrolin=nrolin+3
set_head=true;
}
if ( is_newpag == true ) {
if (npag > 1 ) { fileRpt.writeln('</TABLE>')};
fileRpt.writeln('<H6><I>Dpto. Cuentas a Pagar</B></I><BR><HR>');
fileRpt.writeln('<ALIGN=LEFT><H3><B>LISTADO DE PAGARES EMITIDOS</B></H3>');
// 'Pág.:'+npag+' ');
fileRpt.writeln('<HR>');
is_newpag=false;
nrolin=nrolin+4;
set_head=true;
npag++;
}
if ( set_head == true ) {
fileRpt.writeln('<CENTER><TABLE BORDER=0 ALIGN=CENTER>');
fileRpt.writeln("<TR><TD ALIGN=RIGHT><B>"+c_factreg.nif +"</TD></B>"+
"<TD ALIGN=RIGHT><B>"+c_factreg.razon_social+"</TD></B>");
fileRpt.writeln('</TABLE>');
fileRpt.writeln('<HR><CENTER><TABLE BORDER='+request.borde+' ALIGN=CENTER>');
fileRpt.writeln(" <TR><TD ALIGN=CENTER>Nro. Reg." +
"<TD ALIGN=CENTER>F.Emisión </TD>"+
"<TD ALIGN=CENTER>Nro. Fra.</TD>"+
"<TD ALIGN=CENTER>Centro </TD>"+
"<TD ALIGN=CENTER>Vto. Pago</TD>"+
"<TD ALIGN=CENTER>Importe</TD></TR>");
nrolin=nrolin+3; set_head=false;
}
fileRpt.writeln("<TR><TD ALIGN=RIGHT>"+c_factreg.nro_reg.substring(4,c_factreg.nro_reg.length) + "/" +
c_factreg.nro_reg.substring(0,4) +"</TD>"+
"<TD ALIGN=RIGHT>"+datetoString(c_factreg.f_emision) +"</TD>"+
"<TD ALIGN=RIGHT>"+c_factreg.nro_fra +"</TD>"+
"<TD ALIGN=RIGHT>"+c_factreg.cod_centro +"</TD>"+
"<TD ALIGN=RIGHT>"+datetoString(c_factreg.vto_pago) +"</TD>"+
"<TD ALIGN=RIGHT>"+NroFormat(c_factreg.importe_total,NF9)+"</TD></TR>");
suma_total=suma_total+c_factreg.importe_total;
suma_banco=suma_banco+c_factreg.importe_total;
keyLastRow=c_factreg.nif;
nrolin++;
if (!c_factreg.next())
break;
}
// writeln("<TR><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD ALIGN=RIGHT></TD><TD ALIGN=RIGHT>----------------</TD>");
// writeln("<TR><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD ALIGN=RIGHT>Suma Total:</TD><TD ALIGN=RIGHT>"+NroFormat(suma_total,NF10) +"</TD>");
fileRpt.writeln('</TABLE>');
fileRpt.writeln('<TABLE BORDER=0 ALIGN=CENTER><TR>');
fileRpt.writeln("<TR><TD ALIGN=RIGHT>TOTAL .... </TD>"+
"<TD ALIGN=RIGHT>"+NroFormat(suma_prov,NF11)+"</TD>");
fileRpt.writeln('</TABLE>');
fileRpt.writeln('<HR><TABLE BORDER=0 ALIGN=CENTER><TR>');
fileRpt.writeln("<TR><TD ALIGN=RIGHT>TOTAL Acumulado....... </TD>"+
"<TD ALIGN=RIGHT>"+NroFormat(suma_total,NF11)+"</TD>");
fileRpt.writeln('</TABLE>');
}
function FraRetenidasHtml() {
}

414
l_pedido.html Normal file
View File

@ -0,0 +1,414 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: l_pedido.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>Listado de pedidos</TITLE>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT SRC="l_pedido.js">
</SCRIPT>
</HEAD>
<SERVER>
var NF6=""
var NF8=""
var NF9=""
var NF10=""
var HOY=new Date();
// Algunos formatos para fechas.
var NLDF=""; // para columnas en las queries INFORMIX
var baseHtml="";
var PaperVLines=76// Nro. Lins. del Papel A4 Vertical FONT Default
var PaperHLines=52// Nro. Lins. del Papel A4 Horizontal FONT Default
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons();GoField()"');
else
writeln(' <BODY OnLoad="GoField()"');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="pedido.js">');
writeln('</SCRIPT>');
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln(' function GoField() {');
writeln(' var f=document.l_pedido; ');
writeln('// alert("\\r¡¡¡ !!!"); ');
if (!request.f_orden)
writeln(' f.f_formato.focus();');
if (request.f_orden)
writeln("displayReport();");
writeln(' }');
writeln(' function chkYearNroReg(obj) {');
writeln(' var nro=parseInt(obj.value); ');
writeln(' if (nro+1 > 0 ) { ');
writeln(' obj.value=nro; ');
writeln(' if ( HOY.getFullYear() != nro ) ');
writeln(' alert("¡¡ El Año del Nro. de Registro no es el actual !! ");');
writeln(' }');
writeln(' }');
writeln('function NroPad(obj,longNro) {');
writeln(' if ( obj.value.length == 0 )');
writeln(' return;');
writeln(' if (obj.value.indexOf("*") >= 0) ');
writeln(' return;');
writeln(' c_nro=obj.value;');
writeln(' for (var j=c_nro.length ; j<longNro ; j++ ) {');
writeln(' c_nro="0"+c_nro;');
writeln(' }');
writeln(' obj.value=c_nro.substring(0,longNro);');
writeln('}');
if (request.gofunc) {
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_pedido;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="l_pedido.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
}
writeln('</SCRIPT>');
if( request.f_orden) {
if (!request.gofunc) {
dbConnect();
if (request.desde && request.hasta) {
var desde_fecha=DateFormat(request.desde,NLDF);
if ( desde_fecha.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
var hasta_fecha=DateFormat(request.hasta,NLDF);
if ( hasta_fecha.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
c_pedidos = database.cursor("SELECT * FROM pedidos,proveedores WHERE pedidos.nif=proveedores.nif and "+ client.criteria +" Between '" +
desde_fecha + "' and '"+ hasta_fecha + "' ORDER BY " + client.criteria);
}
else if (request.search1) {
c_pedidos = database.cursor("SELECT * FROM pedidos,proveedores WHERE pedidos.nif=proveedores.nif and "+ client.criteria +" MATCHES '" +
request.search1 + "' ORDER BY " + client.criteria);
}
else if (request.f_orden) {
var criterio=""
if ( request.f_desde.length > 0 ) {
var f_desde=DateFormat(request.f_desde,NLDF);
if ( f_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
criterio=" f_emision >= '"+f_desde+"' "
}
if ( request.f_hasta.length > 0 ) {
var f_hasta=DateFormat(request.f_hasta,NLDF);
if ( f_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" f_emision <= '"+f_hasta+"' "
}
if ( request.v_desde.length > 0 ) {
var v_desde=DateFormat(request.v_desde,NLDF);
if ( v_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago >= '"+v_desde+"' "
}
if ( request.v_hasta.length > 0 ) {
var v_hasta=DateFormat(request.v_hasta,NLDF);
if ( v_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago <= '"+v_hasta+"' "
}
if ( request.h_cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" pedidos.cod_centro >= '"+request.d_cod_centro+"' and pedidos.cod_centro <= '"+request.h_cod_centro+"' "
} else {
if ( request.d_cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" pedidos.cod_centro matches '"+request.d_cod_centro+"'"
}
}
if ( request.nif.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" pedidos.nif matches '"+request.nif+"'"
}
if ( request.h_nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" pedidos.nro_fra >= '"+request.d_nro_fra+"' and pedidos.nro_fra <= '"+request.h_nro_fra+"'"
} else {
if ( request.d_nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" pedidos.nro_fra >= '"+request.d_nro_fra+"'"
}
}
if ( request.h_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" pedidos.mes >= '"+request.d_mes_fra+"' and pedidos.mes <= '"+request.h_mes_fra+"'"
} else {
if ( request.d_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" pedidos.mes >= '"+request.d_mes_fra+"'"
}
}
if ( request.h_nro_regn.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" pedidos.nro_reg >= '"+StringClip(true,request.d_nro_regy)+StringClip(true,request.d_nro_regn)+"' and pedidos.nro_reg <= '"+StringClip(true,request.h_nro_regy)+StringClip(true,request.h_nro_regn)+"'"
} else {
if ( request.d_nro_regn.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" pedidos.nro_reg >= '"+StringClip(true,request.d_nro_regy)+StringClip(true,request.d_nro_regn)+"'"
}
}
if ( request.razon_social.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
var razon_social=request.razon_social;
// var lowcaps = request.razon_social.toLowerCase();
// var uppercaps = request.razon_social.toUpperCase();
criterio=criterio+"razon_social matches '"+razon_social+"'"
}
if (request.f_formato=="proveedor")
request.f_orden=" pedidos.nif,"+request.f_orden;
if (request.f_formato=="centro")
request.f_orden=" pedidos.cod_centro,razon_social,"+request.f_orden;
if (request.f_formato=="pendientes")
request.f_orden=" pedidos.f_recepcion,"+request.f_orden;
if (request.f_formato=="emitidas") {
request.f_orden=" pedidos.cod_banco,pedidos.vto_pago,"+request.f_orden;
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+"f_emision_pago is not null "
}
if (request.f_formato=="provBloq")
request.f_orden=" pedidos.nif,"+request.f_orden;
// if (request.f_formato=="documento")
// request.f_orden=" pedidos.nif,"+request.f_orden;
if (criterio.length > 0 )
criterio=" and "+criterio;
c_factreg = database.cursor("SELECT * FROM pedidos,proveedores,centros WHERE pedidos.nif=proveedores.nif and pedidos.cod_centro=centros.cod_centro"+ criterio +
" ORDER BY " + request.f_orden);
}
if (!c_factreg)
DbsError(false,-1);
else {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln("function displayReport() {");
report_fra();
writeln("}");
writeln("</SCRIPT>");
c_factreg.close();
}
}
}
criterio="Listado";
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RangoFecha(obj,clave) {');
writeln(' if (obj.value.length > 0 ){ ');
writeln(' if (clave == "emision") { ');
writeln(' if (dateCmp(obj.value,document.l_pedido.f_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_pedido.f_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "vto") { ');
writeln(' if (dateCmp(obj.value,document.l_pedido.v_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_pedido.v_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "fecha") { ');
writeln(' if (dateCmp(obj.value,document.l_pedido.desde.value) != 1 ) {');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_pedido.desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' } ');
writeln('} ');
writeln('function HastaDefault(obj,clave) {');
writeln(' if (obj.value.length <= 0 ){ ');
writeln(' if (clave == "emision") ');
writeln(' obj.value=document.l_pedido.f_desde.value;');
writeln(' if (clave == "vto") ');
writeln(' obj.value=document.l_pedido.v_desde.value;');
writeln(' if (clave == "fecha") ');
writeln(' obj.value=document.l_pedido.desde.value;');
writeln(' } ');
writeln('} ');
writeln('</SCRIPT>');
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("pedidos",criterio,"rpt");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="l_pedido.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("pedidos",criterio,"rpt")
writeln('</FORM>');
}
writeln('<FORM NAME="l_pedido" method="Post" action="l_pedido.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM NAME="l_pedido" method="Post" action="l_pedido.html?waux='+request.waux+'&'+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
writeln("<B>Criterios de Seleccion Datos: </B>");
writeln("<HR>");
if (!request.nif)
request.nif="";
if (!request.d_cod_centro)
request.d_cod_centro="";
if (!request.h_cod_centro)
request.h_cod_centro="";
if (!request.razon_social)
request.razon_social="";
if (!request.d_nro_fra)
request.d_nro_fra="";
if (!request.h_nro_fra)
request.h_nro_fra="";
if (!request.d_mes_fra)
request.d_mes_fra="";
if (!request.h_mes_fra)
request.h_mes_fra="";
if (!request.f_desde)
request.f_desde="";
if (!request.f_hasta)
request.f_hasta="";
if (!request.v_desde)
request.v_desde="";
if (!request.v_hasta)
request.v_hasta="";
if (!request.d_nro_regn)
request.d_nro_regn="";
if (!request.d_nro_regy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.d_nro_regy=n;
}
if (!request.h_nro_regn)
request.h_nro_regn="";
if (!request.h_nro_regy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.h_nro_regy=n;
}
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TR><TD ALIGN=LEFT><B>Formato: </B></TD><TD><SELECT NAME="f_formato" SIZE=1>');
writeln('<OPTION VALUE="documento" SELECTED>Documento Registrado');
writeln('<OPTION VALUE="proveedor" >Por Proveedor');
writeln('<OPTION VALUE="centro" >Por Centro');
writeln('<OPTION VALUE="pendientes" >Pendientes de Pago');
writeln('<OPTION VALUE="emitidas" >Emitidas');
writeln('<OPTION VALUE="provBloq" >Retenidas');
writeln('</SELECT>');
writeln("<INPUT type='hidden' name='f_tipo' size=4 maxlength=4 VALUE='html' >");
writeln("<INPUT type='text' name='maxLins' size=2 maxlength=2 VALUE='76' > ( 76 A4 V. 52 A4 H.)");
writeln('<TD ALIGN=LEFT><B>Borde: </B></TD><TD><SELECT NAME="borde" SIZE=1>');
writeln('<OPTION VALUE="0" SELECTED>No');
writeln('<OPTION VALUE="1" >Fino');
writeln('<OPTION VALUE="2" >Medio');
writeln('<OPTION VALUE="3" >Grueso');
writeln('</SELECT>');
writeln("</TD></TR>");
// writeln('<B>Tipo: </B><SELECT NAME="f_tipo" SIZE=1>');
// writeln('<OPTION VALUE="html" SELECTED>HTML');
// writeln('<OPTION VALUE="ascii" >ASCII');
// writeln('</SELECT></TD></TR>');
writeln('</TABLE>');
writeln("<HR>");
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Reg.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_regn" VALUE="'+request.d_nro_regn+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="d_nro_regy" VALUE="'+request.d_nro_regy+'" SIZE=4 OnChange="chkYearNroReg(this)">');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_regn" VALUE="'+request.h_nro_regn+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="h_nro_regy" VALUE="'+request.h_nro_regy+'" SIZE=4 OnChange="chkYearNroReg(this)"><INPUT TYPE="submit" value=" / "></TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Fra.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_fra" VALUE="'+request.d_nro_fra+'" SIZE=12 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_fra" VALUE="'+request.h_nro_fra+'" SIZE=12 > </TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Mes.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_mes_fra" VALUE="'+request.d_mes_fra+'" SIZE=2 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_mes_fra" VALUE="'+request.h_mes_fra+'" SIZE=2 > </TD>');
writeln("<TR><TD ALIGN=LEFT>N.I.F. .......: </TD><TD><INPUT type='text' name='nif' size=12 maxlength=12 VALUE='"+request.nif +"' onChange='this.value=this.value.toUpperCase()' > </TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Razón Social .: </TD><TD><INPUT type='text' name='razon_social' size=30 maxlength=40 VALUE='"+request.razon_social +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Código Centro Desde: </TD><TD><INPUT type='text' name='d_cod_centro' size=12 maxlength=12 VALUE='"+request.d_cod_centro +"' >");
writeln("Hasta: <INPUT type='text' name='h_cod_centro' size=12 maxlength=12 VALUE='"+request.h_cod_centro +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Emitida Desde: </TD><TD><INPUT type='text' name='f_desde' size=8 maxlength=10 VALUE='"+request.f_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='f_hasta' size=8 maxlength=10 VALUE='"+request.f_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"emision\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"emision\")' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Vto. Pago Desde: </TD><TD><INPUT type='text' name='v_desde' size=8 maxlength=10 VALUE='"+request.v_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='v_hasta' size=8 maxlength=10 VALUE='"+request.v_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"vto\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"vto\")''></TD></TR>");
writeln('<TR><TD ALIGN=LEFT>Ordenado por: </TD><TD><SELECT NAME="f_orden" SIZE=1>');
writeln('<OPTION VALUE="razon_social" >Razón Social');
writeln('<OPTION VALUE="nif" >N.I.F.');
writeln('<OPTION VALUE="nro_fra" >Nro.Fra. ');
writeln('<OPTION VALUE="nro_reg" SELECTED>Nro.Reg. ');
writeln('<OPTION VALUE="f_emision" >Fecha Emisión');
writeln('<OPTION VALUE="vto_pago" >Vto. Pago');
writeln('<OPTION VALUE="cod_centro" >Centro ');
writeln('<OPTION VALUE="f_emision" >Fecha Pago ');
writeln('<OPTION VALUE="vto_pago" >Vto. Pago ');
writeln('</SELECT></TD></TR></TABLE>');
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('</FORM>');
writeln("<CENTER>");
if (!request.waux) {
refHtml="l_pedido.html?"+baseHtml+"&search2=";
}
else {
refHtml="l_pedido.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
if (!request.waux)
writeSignature(true);
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

160
l_prevision.html Normal file
View File

@ -0,0 +1,160 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: l_factura.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>Listado de facturas</TITLE>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT SRC="l_prevision.js">
</SCRIPT>
</HEAD>
<SERVER>
var NF9=""
var NF10=""
var NF11=""
var HOY=new Date();
var nlin=0;
// Algunos formatos para fechas.
var NLDF=""; // para columnas en las queries INFORMIX
var baseHtml="";
var pathFile="c:/tmprpts/";
var urlDoc="file:///C|/tmprpts/prevision.html" // Donde leen los Clients
var nprinter="";
var spoolpath="";
var baseHtml="";
var textoReqs="";
var nomFile="c:/tmprpts/prevision.html";
var PaperVLines=76// Nro. Lins. del Papel A4 Vertical FONT Default
var PaperHLines=52// Nro. Lins. del Papel A4 Horizontal FONT Default
criterio="";
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons();GoField()"');
else
writeln(' <BODY OnLoad="GoField()"');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln(' function GoField() {');
writeln('// alert("\\r¡¡¡ !!!"); ');
if (request.f_entrada)
writeln("displayReport();");
writeln(' }');
writeln(' function chkYearNroReg(obj) {');
writeln(' var nro=parseInt(obj.value); ');
writeln(' if (nro+1 > 0 ) { ');
writeln(' obj.value=nro; ');
writeln(' if ( HOY.getFullYear() != nro ) ');
writeln(' alert("¡¡ El Año del Nro. de Registro no es el actual !! ");');
writeln(' }');
writeln(' }');
if (request.gofunc) {
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_factura;');
writeln(' if ( obj == "Alta" ) {');
writeln(' //;');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
}
writeln('</SCRIPT>');
if (request.f_entrada) {
if (!request.gofunc) {
dbConnect();
report_prev();
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln("function displayReport() {");
writeln('w_prev=window.open("'+urlDoc+'","w_prevision","toolbar=yes,directories=no,menubar=yes,status=no,scrollbars=yes,resizable=yes,width=600,height=500");');
// if ( textoReqs.length > 0 )
// writeln(' alert("Listado(s): '+textoReqs+'\\r está(n) en la cola \''+nprinter+'\'"); ');
writeln("}");
writeln("</SCRIPT>");
}
}
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Previsiones",criterio,"rpt");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="l_prevision.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("Previsiones",criterio,"rpt")
writeln('</FORM>');
}
writeln('<FORM NAME="l_prevision" method="Post" action="l_prevision.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM NAME="l_prevision" method="Post" action="l_prevision.html?waux='+request.waux+'&'+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
writeln("<B>Criterios de Seleccion Datos: </B>");
writeln("<HR>");
if (!request.f_entrada)
request.f_entrada="";
writeln('<TABLE ALIGN="CENTER" BORDER=0><TR>');
writeln("<INPUT type='hidden' name='f_tipo' size=4 maxlength=4 VALUE='html' >");
writeln("<INPUT type='hidden' name='maxLins' size=2 maxlength=2 VALUE='76' >");
writeln('<TD ALIGN=LEFT><B>Borde: </B></TD><TD><SELECT NAME="borde" SIZE=1>');
writeln('<OPTION VALUE="0" SELECTED>No');
writeln('<OPTION VALUE="1" >Fino');
writeln('<OPTION VALUE="2" >Medio');
writeln('<OPTION VALUE="3" >Grueso');
writeln('</SELECT>');
writeln("</TD></TR>");
writeln('</TABLE>');
writeln("<HR>");
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln("<TR><TD ALIGN=LEFT>Desde: </TD><TD><INPUT type='text' name='f_entrada' size=8 maxlength=10 VALUE='"+request.f_entrada +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
// writeln("Hasta: <INPUT type='text' name='f_hasta' size=8 maxlength=10 VALUE='"+request.f_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"emision\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"emision\")' ></TD></TR>");
writeln('</SELECT></TD></TR></TABLE>');
writeln('<INPUT TYPE="submit" value="Buscar">');
if (!request.waux) {
refHtml="l_prevision.html?"+baseHtml+"&search2=";
}
else {
refHtml="l_prevision.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
writeln('</FORM>');
writeln("<CENTER>");
if (!request.waux)
writeSignature(true);
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

159
l_prevision.js Normal file
View File

@ -0,0 +1,159 @@
//////////////////////////////////////
// //
// JavaScript Functions //
// //
//////////////////////////////////////
function report_prev() {
var npag=0;
var nrolin=0;
// if (request.f_formato=="documento")
PrevisionHtml();
}
function PrevisionHtml() {
request.sumaret=0;
request.sumapag=0;
request.sumatal=0;
request.linea="";
request.suma_lin=0;
request.suma_tot=0;
var nrolin=0;
var set_head=true;
// var s_seq=getSeqPrt(nprinter);
// textoReqs=textoReqs+" "+s_seq;
// var nomFile=spoolpath+nprinter+"/req_"+s_seq+".html"
fileRpt=new File(nomFile);
fileRpt.open("w");
fileRpt.writeln('<HTML><HEAD></HEAD>');
fileRpt.writeln('<BASEFONT SIZE=1>');
fileRpt.writeln('<FONT SIZE=1>');
var keyLastRow="-";
c_vtosDate = database.cursor("SELECT unique vto_pago from facturas where tipo_doc_pago = '1' "+
" and vto_pago >='"+
request.f_entrada+"' order by vto_pago ")
c_bancos = database.cursor("SELECT cod_banco,nombre FROM bancos where is_locked != 'S' ORDER BY cod_banco ");
while (c_bancos.next()) {
eval ("request.sum_"+c_bancos.cod_banco+"=0");
}
c_bancos.close();
while (c_vtosDate.next()){
if ( nrolin+3 == request.maxLins ) {
fileRpt.writeln('<BR><BR><BR>');
nrolin=0;
set_head=true;
};
if ( set_head == true ) {
nrolin=nrolin+2;
if ( keyLastRow !="-" )
fileRpt.writeln("</TABLE>");
PrevisionCab();
set_head=false;
}
if ( nrolin+1 > request.maxLins ) {
skipTopPage(nrolin,request.maxLins);
nrolin=6;
fileRpt.writeln("</TABLE>");
PrevisionCab();
}
c_bancos = database.cursor("SELECT cod_banco,nombre FROM bancos where is_locked != 'S' ORDER BY cod_banco ");
request.linea="<TD ALIGN=RIGHT><FONT SIZE=1>"+datetoString(c_vtosDate.vto_pago)+"</TD>";
request.suma_lin=0;
while (c_bancos.next()) {
c_vtos = database.cursor("SELECT sum(importe_total) from facturas where tipo_doc_pago = '1' "+
" and cod_banco = '"+c_bancos.cod_banco+
"' and vto_pago ='"+datetoString(c_vtosDate.vto_pago)+
"'")
c_vtos.next();
numero=0;
if ( c_vtos[0] > 0 || c_vtos[0] < 0 )
numero=c_vtos[0];
request.linea=request.linea+"<TD ALIGN=RIGHT><FONT SIZE=1>"+NroFormat(numero,NF11)+"</TD>"
eval ("request.sum_"+c_bancos.cod_banco+"=parseFloat(request.sum_"+c_bancos.cod_banco+")+parseFloat("+numero+")");
request.suma_lin=parseFloat(request.suma_lin)+parseFloat(numero);
c_vtos.close();
}
c_bancos.close();
c_pagemi = database.cursor("SELECT sum(importe_total),f_pago,tipo_doc_pago from facturas where tipo_doc_pago ='2' "+
" and vto_pago is null and f_pago ='"+
datetoString(c_vtosDate.vto_pago)+"' group by tipo_doc_pago, f_pago order by f_pago,tipo_doc_pago")
c_pagemi.next();
// Suma de Pagos tipo 2
numero=0;
if ( c_pagemi[0] > 0 || c_pagemi[0] < 0 )
numero=c_pagemi[0];
request.linea=request.linea+"<TD ALIGN=RIGHT><FONT SIZE=1>"+NroFormat(numero,NF11)+"</TD>"
request.sumtal=parseFloat(request.sumatal+numero);
request.suma_lin=parseFloat(request.suma_lin)+parseFloat(numero);
c_pagemi.close();
c_pagemi = database.cursor("SELECT sum(importe_total),f_pago,tipo_doc_pago from facturas where tipo_doc_pago = '1' "+
" and vto_pago is null and f_pago ='"+
datetoString(c_vtosDate.vto_pago)+"' group by tipo_doc_pago, f_pago order by f_pago,tipo_doc_pago")
c_pagemi.next();
// Suma de Pagos tipo 1
numero=0;
if ( c_pagemi[0] > 0 || c_pagemi[0] < 0 )
numero=c_pagemi[0];
request.linea=request.linea+"<TD ALIGN=RIGHT><FONT SIZE=1>"+NroFormat(numero,NF11)+"</TD>"
request.sumpag=parseFloat(request.sumapag+numero);
request.suma_lin=parseFloat(request.suma_lin)+parseFloat(numero);
c_pagemi.close();
c_reten = database.cursor("SELECT sum(importe_total),f_pago from facturas,proveedores where tipo_doc_pago between '1' and '2' "+
" and f_emision_pago is null and f_pago ='"+
datetoString(c_vtosDate.vto_pago)+"' "+
" and facturas.nif=proveedores.nif "+
" and ( proveedores.cond_pago = '99' or facturas.cond_pago = '99' )"+
" group by cod_banco,f_pago order by f_pago")
c_reten.next();
// Suma de Retenciones
numero=0;
if ( c_reten[0] > 0 || c_reten[0] < 0 )
numero=c_reten[0];
request.linea=request.linea+"<TD ALIGN=RIGHT><FONT SIZE=1>"+NroFormat(numero,NF11)+"</TD>"
request.sumret=parseFloat(request.sumaret+numero);
request.suma_lin=parseFloat(request.suma_lin)+parseFloat(numero);
c_reten.close();
keyLastRow=c_vtosDate.vto_pago;
request.suma_tot=parseFloat(request.suma_tot)+parseFloat(request.suma_lin);
request.linea=request.linea+"<TD ALIGN=RIGHT><FONT SIZE=1>"+NroFormat(request.suma_lin,NF11)+"</TD>"
nrolin++;
fileRpt.writeln("<TR>"+request.linea+"</TR>")
}
// Acumulados totales
c_vtosDate.close();
request.linea="";
c_bancos = database.cursor("SELECT cod_banco,nombre FROM bancos where is_locked != 'S' ORDER BY cod_banco ");
while (c_bancos.next()) {
eval ("request.linea=request.linea+'<TD ALIGN=RIGHT><FONT SIZE=1>'+NroFormat(request.sum_"+c_bancos.cod_banco+",NF11)+'</TD>'");
}
c_bancos.close();
request.linea=request.linea+"<TD ALIGN=RIGHT><FONT SIZE=1>"+NroFormat(request.sumatal,NF11)+"</TD>"
request.linea=request.linea+"<TD ALIGN=RIGHT><FONT SIZE=1>"+NroFormat(request.sumapag,NF11)+"</TD>"
request.linea=request.linea+"<TD ALIGN=RIGHT><FONT SIZE=1>"+NroFormat(request.sumaret,NF11)+"</TD>"
request.linea=request.linea+"<TD ALIGN=RIGHT><FONT SIZE=1>"+NroFormat(request.suma_tot,NF11)+"</TD>"
fileRpt.writeln("<TR><TD><FONT SIZE=1>TOTALES</TD>"+request.linea+"</TR>");
fileRpt.writeln('</TABLE>');
fileRpt.writeln('</BODY>');
fileRpt.writeln('</HTML>');
fileRpt.close();
}
function PrevisionCab() {
request.linea="";
fileRpt.writeln('<H6><I>Dpto. Cuentas a Pagar</FONT></I>');
fileRpt.writeln('<HR>');
fileRpt.writeln('<ALIGN=CENTER><H4><B>PREVISIONES</B></H4>');
fileRpt.writeln('<HR>');
fileRpt.writeln('</TABLE><ALIGN=LEFT>');
fileRpt.writeln('<TABLE BORDER='+request.borde+' ALIGN=CENTER CELLSPACING=0 CELLPADDING=4 VALIGN="TOP">');
c_bancos = database.cursor("SELECT cod_banco,acronimo FROM bancos where is_locked != 'S' ORDER BY cod_banco ");
while (c_bancos.next()) {
request.linea=request.linea+"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><I><FONT SIZE=1>"+c_bancos.acronimo+"</I></TH> ";
}
c_bancos.close();
request.linea=request.linea+"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><I><FONT SIZE=1>CONTADO</I></TH> ";
request.linea=request.linea+"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><I><FONT SIZE=1>PAGARES</I></TH> ";
request.linea=request.linea+"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><I><FONT SIZE=1>RETENIDO</I></TH> ";
request.linea=request.linea+"<TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><I><FONT SIZE=1>TOTALES</I></TH> ";
fileRpt.writeln("<TR><TH ALIGN=RIGHT NOWRAP VALIGN=TOP ><I><FONT SIZE=1> VTOS.</I></TH> "+request.linea+"</TR>");
}

414
l_proveedor.html Normal file
View File

@ -0,0 +1,414 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: l_proveedor.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>Listado de proveedores</TITLE>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT SRC="l_proveedor.js">
</SCRIPT>
</HEAD>
<SERVER>
var NF6=""
var NF8=""
var NF9=""
var NF10=""
var HOY=new Date();
// Algunos formatos para fechas.
var NLDF=""; // para columnas en las queries INFORMIX
var baseHtml="";
var PaperVLines=76// Nro. Lins. del Papel A4 Vertical FONT Default
var PaperHLines=52// Nro. Lins. del Papel A4 Horizontal FONT Default
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons();GoField()"');
else
writeln(' <BODY OnLoad="GoField()"');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="proveedor.js">');
writeln('</SCRIPT>');
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln(' function GoField() {');
writeln(' var f=document.l_proveedor; ');
writeln('// alert("\\r¡¡¡ !!!"); ');
if (!request.f_orden)
writeln(' f.f_formato.focus();');
if (request.f_orden)
writeln("displayReport();");
writeln(' }');
writeln(' function chkYearNroReg(obj) {');
writeln(' var nro=parseInt(obj.value); ');
writeln(' if (nro+1 > 0 ) { ');
writeln(' obj.value=nro; ');
writeln(' if ( HOY.getFullYear() != nro ) ');
writeln(' alert("¡¡ El Año del Nro. de Registro no es el actual !! ");');
writeln(' }');
writeln(' }');
writeln('function NroPad(obj,longNro) {');
writeln(' if ( obj.value.length == 0 )');
writeln(' return;');
writeln(' if (obj.value.indexOf("*") >= 0) ');
writeln(' return;');
writeln(' c_nro=obj.value;');
writeln(' for (var j=c_nro.length ; j<longNro ; j++ ) {');
writeln(' c_nro="0"+c_nro;');
writeln(' }');
writeln(' obj.value=c_nro.substring(0,longNro);');
writeln('}');
if (request.gofunc) {
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.g_proveedor;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="l_proveedor.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
}
writeln('</SCRIPT>');
if( request.f_orden) {
if (!request.gofunc) {
dbConnect();
if (request.desde && request.hasta) {
var desde_fecha=DateFormat(request.desde,NLDF);
if ( desde_fecha.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
var hasta_fecha=DateFormat(request.hasta,NLDF);
if ( hasta_fecha.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
c_proveedores = database.cursor("SELECT * FROM proveedores,proveedores WHERE proveedores.nif=proveedores.nif and "+ client.criteria +" Between '" +
desde_fecha + "' and '"+ hasta_fecha + "' ORDER BY " + client.criteria);
}
else if (request.search1) {
c_proveedores = database.cursor("SELECT * FROM proveedores,proveedores WHERE proveedores.nif=proveedores.nif and "+ client.criteria +" MATCHES '" +
request.search1 + "' ORDER BY " + client.criteria);
}
else if (request.f_orden) {
var criterio=""
if ( request.f_desde.length > 0 ) {
var f_desde=DateFormat(request.f_desde,NLDF);
if ( f_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
criterio=" f_emision >= '"+f_desde+"' "
}
if ( request.f_hasta.length > 0 ) {
var f_hasta=DateFormat(request.f_hasta,NLDF);
if ( f_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" f_emision <= '"+f_hasta+"' "
}
if ( request.v_desde.length > 0 ) {
var v_desde=DateFormat(request.v_desde,NLDF);
if ( v_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago >= '"+v_desde+"' "
}
if ( request.v_hasta.length > 0 ) {
var v_hasta=DateFormat(request.v_hasta,NLDF);
if ( v_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago <= '"+v_hasta+"' "
}
if ( request.h_cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" proveedores.cod_centro >= '"+request.d_cod_centro+"' and proveedores.cod_centro <= '"+request.h_cod_centro+"' "
} else {
if ( request.d_cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" proveedores.cod_centro matches '"+request.d_cod_centro+"'"
}
}
if ( request.nif.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" proveedores.nif matches '"+request.nif+"'"
}
if ( request.h_nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" proveedores.nro_fra >= '"+request.d_nro_fra+"' and proveedores.nro_fra <= '"+request.h_nro_fra+"'"
} else {
if ( request.d_nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" proveedores.nro_fra >= '"+request.d_nro_fra+"'"
}
}
if ( request.h_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" proveedores.mes >= '"+request.d_mes_fra+"' and proveedores.mes <= '"+request.h_mes_fra+"'"
} else {
if ( request.d_mes_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" proveedores.mes >= '"+request.d_mes_fra+"'"
}
}
if ( request.h_nro_regn.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" proveedores.nro_reg >= '"+StringClip(true,request.d_nro_regy)+StringClip(true,request.d_nro_regn)+"' and proveedores.nro_reg <= '"+StringClip(true,request.h_nro_regy)+StringClip(true,request.h_nro_regn)+"'"
} else {
if ( request.d_nro_regn.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" proveedores.nro_reg >= '"+StringClip(true,request.d_nro_regy)+StringClip(true,request.d_nro_regn)+"'"
}
}
if ( request.razon_social.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
var razon_social=request.razon_social;
// var lowcaps = request.razon_social.toLowerCase();
// var uppercaps = request.razon_social.toUpperCase();
criterio=criterio+"razon_social matches '"+razon_social+"'"
}
if (request.f_formato=="proveedor")
request.f_orden=" proveedores.nif,"+request.f_orden;
if (request.f_formato=="centro")
request.f_orden=" proveedores.cod_centro,razon_social,"+request.f_orden;
if (request.f_formato=="pendientes")
request.f_orden=" proveedores.f_recepcion,"+request.f_orden;
if (request.f_formato=="emitidas") {
request.f_orden=" proveedores.cod_banco,proveedores.vto_pago,"+request.f_orden;
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+"f_emision_pago is not null "
}
if (request.f_formato=="provBloq")
request.f_orden=" proveedores.nif,"+request.f_orden;
// if (request.f_formato=="documento")
// request.f_orden=" proveedores.nif,"+request.f_orden;
if (criterio.length > 0 )
criterio=" and "+criterio;
c_factreg = database.cursor("SELECT * FROM proveedores,proveedores,centros WHERE proveedores.nif=proveedores.nif and proveedores.cod_centro=centros.cod_centro"+ criterio +
" ORDER BY " + request.f_orden);
}
if (!c_factreg)
DbsError(false,-1);
else {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln("function displayReport() {");
report_fra();
writeln("}");
writeln("</SCRIPT>");
c_factreg.close();
}
}
}
criterio="Listado";
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function RangoFecha(obj,clave) {');
writeln(' if (obj.value.length > 0 ){ ');
writeln(' if (clave == "emision") { ');
writeln(' if (dateCmp(obj.value,document.l_proveedor.f_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_proveedor.f_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "vto") { ');
writeln(' if (dateCmp(obj.value,document.l_proveedor.v_desde.value) != 1 ) {;');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_proveedor.v_desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' if (clave == "fecha") { ');
writeln(' if (dateCmp(obj.value,document.l_proveedor.desde.value) != 1 ) {');
writeln(' alert("¡ El Rango de Fechas no es posible !");');
writeln(' obj.value="";');
writeln(' document.g_proveedor.desde.focus();');
writeln(' } ');
writeln(' } ');
writeln(' } ');
writeln('} ');
writeln('function HastaDefault(obj,clave) {');
writeln(' if (obj.value.length <= 0 ){ ');
writeln(' if (clave == "emision") ');
writeln(' obj.value=document.l_proveedor.f_desde.value;');
writeln(' if (clave == "vto") ');
writeln(' obj.value=document.l_proveedor.v_desde.value;');
writeln(' if (clave == "fecha") ');
writeln(' obj.value=document.l_proveedor.desde.value;');
writeln(' } ');
writeln('} ');
writeln('</SCRIPT>');
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("proveedores",criterio,"rpt");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="l_proveedor.html?'+baseHtml+'&nvo=1">');
QueryHeadBar("proveedores",criterio,"rpt")
writeln('</FORM>');
}
writeln('<FORM NAME="l_proveedor" method="Post" action="l_proveedor.html?'+baseHtml+'">');
}
}
else {
writeln('<FORM NAME="l_proveedor" method="Post" action="l_proveedor.html?waux='+request.waux+'&'+baseHtml+'">');
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
}
writeln("<B>Criterios de Seleccion Datos: </B>");
writeln("<HR>");
if (!request.nif)
request.nif="";
if (!request.d_cod_centro)
request.d_cod_centro="";
if (!request.h_cod_centro)
request.h_cod_centro="";
if (!request.razon_social)
request.razon_social="";
if (!request.d_nro_fra)
request.d_nro_fra="";
if (!request.h_nro_fra)
request.h_nro_fra="";
if (!request.d_mes_fra)
request.d_mes_fra="";
if (!request.h_mes_fra)
request.h_mes_fra="";
if (!request.f_desde)
request.f_desde="";
if (!request.f_hasta)
request.f_hasta="";
if (!request.v_desde)
request.v_desde="";
if (!request.v_hasta)
request.v_hasta="";
if (!request.d_nro_regn)
request.d_nro_regn="";
if (!request.d_nro_regy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.d_nro_regy=n;
}
if (!request.h_nro_regn)
request.h_nro_regn="";
if (!request.h_nro_regy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.h_nro_regy=n;
}
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TR><TD ALIGN=LEFT><B>Formato: </B></TD><TD><SELECT NAME="f_formato" SIZE=1>');
writeln('<OPTION VALUE="documento" SELECTED>Documento Registrado');
writeln('<OPTION VALUE="proveedor" >Por Proveedor');
writeln('<OPTION VALUE="centro" >Por Centro');
writeln('<OPTION VALUE="pendientes" >Pendientes de Pago');
writeln('<OPTION VALUE="emitidas" >Emitidas');
writeln('<OPTION VALUE="provBloq" >Retenidas');
writeln('</SELECT>');
writeln("<INPUT type='hidden' name='f_tipo' size=4 maxlength=4 VALUE='html' >");
writeln("<INPUT type='text' name='maxLins' size=2 maxlength=2 VALUE='76' > ( 76 A4 V. 52 A4 H.)");
writeln('<TD ALIGN=LEFT><B>Borde: </B></TD><TD><SELECT NAME="borde" SIZE=1>');
writeln('<OPTION VALUE="0" SELECTED>No');
writeln('<OPTION VALUE="1" >Fino');
writeln('<OPTION VALUE="2" >Medio');
writeln('<OPTION VALUE="3" >Grueso');
writeln('</SELECT>');
writeln("</TD></TR>");
// writeln('<B>Tipo: </B><SELECT NAME="f_tipo" SIZE=1>');
// writeln('<OPTION VALUE="html" SELECTED>HTML');
// writeln('<OPTION VALUE="ascii" >ASCII');
// writeln('</SELECT></TD></TR>');
writeln('</TABLE>');
writeln("<HR>");
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Reg.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_regn" VALUE="'+request.d_nro_regn+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="d_nro_regy" VALUE="'+request.d_nro_regy+'" SIZE=4 OnChange="chkYearNroReg(this)">');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_regn" VALUE="'+request.h_nro_regn+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="h_nro_regy" VALUE="'+request.h_nro_regy+'" SIZE=4 OnChange="chkYearNroReg(this)"><INPUT TYPE="submit" value=" / "></TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Fra.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_fra" VALUE="'+request.d_nro_fra+'" SIZE=12 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_fra" VALUE="'+request.h_nro_fra+'" SIZE=12 > </TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Mes.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_mes_fra" VALUE="'+request.d_mes_fra+'" SIZE=2 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_mes_fra" VALUE="'+request.h_mes_fra+'" SIZE=2 > </TD>');
writeln("<TR><TD ALIGN=LEFT>N.I.F. .......: </TD><TD><INPUT type='text' name='nif' size=12 maxlength=12 VALUE='"+request.nif +"' onChange='this.value=this.value.toUpperCase()' > </TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Razón Social .: </TD><TD><INPUT type='text' name='razon_social' size=30 maxlength=40 VALUE='"+request.razon_social +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Código Centro Desde: </TD><TD><INPUT type='text' name='d_cod_centro' size=12 maxlength=12 VALUE='"+request.d_cod_centro +"' >");
writeln("Hasta: <INPUT type='text' name='h_cod_centro' size=12 maxlength=12 VALUE='"+request.h_cod_centro +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Emitida Desde: </TD><TD><INPUT type='text' name='f_desde' size=8 maxlength=10 VALUE='"+request.f_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='f_hasta' size=8 maxlength=10 VALUE='"+request.f_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"emision\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"emision\")' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Vto. Pago Desde: </TD><TD><INPUT type='text' name='v_desde' size=8 maxlength=10 VALUE='"+request.v_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='v_hasta' size=8 maxlength=10 VALUE='"+request.v_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"vto\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"vto\")''></TD></TR>");
writeln('<TR><TD ALIGN=LEFT>Ordenado por: </TD><TD><SELECT NAME="f_orden" SIZE=1>');
writeln('<OPTION VALUE="razon_social" >Razón Social');
writeln('<OPTION VALUE="nif" >N.I.F.');
writeln('<OPTION VALUE="nro_fra" >Nro.Fra. ');
writeln('<OPTION VALUE="nro_reg" SELECTED>Nro.Reg. ');
writeln('<OPTION VALUE="f_emision" >Fecha Emisión');
writeln('<OPTION VALUE="vto_pago" >Vto. Pago');
writeln('<OPTION VALUE="cod_centro" >Centro ');
writeln('<OPTION VALUE="f_emision" >Fecha Pago ');
writeln('<OPTION VALUE="vto_pago" >Vto. Pago ');
writeln('</SELECT></TD></TR></TABLE>');
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('</FORM>');
writeln("<CENTER>");
if (!request.waux) {
refHtml="l_proveedor.html?"+baseHtml+"&search2=";
}
else {
refHtml="l_proveedor.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
if (!request.waux)
writeSignature(true);
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

386
l_trasp_old.js Normal file
View File

@ -0,0 +1,386 @@
//////////////////////////////////////
// //
// JavaScript Functions //
// //
//////////////////////////////////////
function wrtraspaso(text){
// writeln("w_outtraspaso.document.write('"+text+"\\n');");
fileRpt.writeln(text);
}
function chk_traspaso() {
var query;
c_query = database.cursor("select * FROM traspaso WHERE uid=\'" + request.uid+ "\'");
if (c_query.next()) {
request.criterio=StringClip(false,c_query.criterio);
request.f_traspaso=StringClip(false,c_query.f_traspaso);
request.f_emision=StringClip(false,c_query.f_emision);
request.f_nro_doc=StringClip(false,c_query.f_nro_doc);
request.sel_order=StringClip(false,c_query.sel_order);
writeln(' alert("\\r Existe un Traspaso de '+request.f_traspaso+' Pendientes de Confirmación !!!"); ');
request.opt_traspaso="true";
}
c_query.close();
if (request.opt_traspaso)
return true
else
return false
}
function insertaTrasp() {
status=database.execute('INSERT INTO traspaso(' +
' uid,' +
' sel_order,'+
' criterio,'+
' f_traspaso,'+
' f_emision,'+
' f_nro_doc ) VALUES ("' + request.uid+ '","' +
request.sel_order + '","'+
request.criterio + '","'+
request.f_traspaso + '","'+
request.f_emision + '","'+
request.f_nro_doc + '")');
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect(addClient('error.html?alert=14'));
}
}
function report_traspaso() {
client.is_trans=true;
database.beginTransaction();
insertaTrasp();
out_traspaso();
database.commitTransaction();
client.is_trans=false;
}
function rpt_traspaso_Doc() {
writeln('w_carta=window.open("'+urlDoc+'","w_traspaso","toolbar=yes,directories=no,menubar=yes,status=no,scrollbars=yes,resizable=yes,width=600,height=500");');
}
function rpt_traspaso_Data() {
writeln('w_carta=window.open("'+urlData+'","w_traspaso","toolbar=yes,directories=no,menubar=yes,status=no,scrollbars=yes,resizable=yes,width=600,height=500");');
}
function cleanup_traspaso() {
// Borramos en tabla de pagos datos del usuario
status=database.execute("DELETE FROM traspaso WHERE uid=\'" + request.uid+ "\'");
return;
}
function out_traspaso() {
var Clave="-";
var SumaTotal=0;
var fileRpt=new File(nomDoc);
fileRpt.open("w");
var fileData=new File(nomData);
fileData.open("w");
fileRpt.writeln('<HTML>');
fileRpt.writeln('<HEAD></HEAD>');
fileRpt.writeln('<BODY>');
fileRpt.writeln('<B><I><CENTER> Traspaso de Facturas - '+request.f_traspaso+' - </B></I>');
if (request.f_traspaso=="gasto")
fileRpt.writeln('<FONT SIZE=1>');
else
fileRpt.writeln('<FONT SIZE=1>');
fileRpt.writeln('<PRE> ');
fileRpt.writeln('<HR>');
if (request.f_traspaso=="gasto")
fileRpt.writeln('<B>N.Doc. Línea Fecha Centro Cuenta Cv. DEBE HABER C o n c e p t o F. Vto. Contrap.</B>');
else {
fileRpt.writeln('<TABLE ALIGN="CENTER" BORDER=0>');
fileRpt.writeln('<B>N.Doc. Línea Fecha Centro Cuenta Cv. DEBE HABER C o n c e p t o F. Vto. Contrap.</B>');
}
fileRpt.writeln('<HR>');
linea=" ";
// c_traspaso = database.cursor("SELECT * FROM traspaso WHERE uid="+ request.uid+" ORDER BY nro_reg ");
var nlin=1
var nro_doc=NroUnformat(request.f_nro_doc);
while (c_traspdocs.next()) {
if (request.f_traspaso=="pago")
c_traspaso = database.cursor("SELECT * FROM facturas,proveedores WHERE facturas.nif=proveedores.nif "+
" and nro_doc_pago='"+c_traspdocs.nro_doc_pago+"' "+
" ORDER BY " + request.sel_order);
if (request.f_traspaso=="gasto")
c_traspaso = database.cursor("SELECT * FROM facturas,proveedores WHERE facturas.nif=proveedores.nif "+
" and nro_reg='"+c_traspdocs.nro_reg+"' "+
" ORDER BY " + request.sel_order);
if (request.f_traspaso=="vto")
c_traspaso = database.cursor("SELECT * FROM facturas,proveedores WHERE facturas.nif=proveedores.nif "+
" and nro_reg_vto='"+c_traspdocs.nro_reg_vto+"' "+
" ORDER BY " + request.sel_order);
while (c_traspaso.next()) {
request.razon_social=c_traspaso.razon_social;
if ( request.f_traspaso=="pago" && Clave == c_traspaso.nro_doc_pago )
continue;
if ( request.f_traspaso=="vto" && Clave == c_traspaso.nro_reg_vto )
continue ;
nrolin=1;
if (request.f_traspaso!="vto")
CursorTabla("acf","nro_reg","=\'"+c_traspaso.nro_reg+"\' order by nro_lin ",false,"");
if (request.f_traspaso=="gasto") {
fileRpt.writeln('<TABLE ALIGN="CENTER" BORDER=0>');
while (c_aptectasfra.next()) {
make_apte(nro_doc,"",StringClip(false,c_traspaso.cta_contable),"",nrolin,0);
// if ( nrolin+1 > request.maxLins ) {
// skipTopPage(nrolin,request.maxLins);
// nrolin=0;
// }
fileData.writeln(request.linea);
fileRpt.writeln(request.lindoc);
nrolin++;
}
fileRpt.writeln('</TABLE>');
} else {
if (request.f_traspaso!="vto")
c_aptectasfra.next();
// fileRpt.writeln('<TABLE ALIGN="CENTER" BORDER=0>');
if (request.f_traspaso=="pago")
CursorTabla("fa","nro_doc_pago","=\'"+c_traspaso.nro_doc_pago+"\'",true,"");
if (request.f_traspaso=="vto")
CursorTabla("fa","nro_reg_vto","=\'"+c_traspaso.nro_reg_vto+"\'",true,"");
SumaTotal=0;
request.cta_contable=c_traspaso.cta_contable;
request.f_emision_pago=datetoString(c_traspaso.f_emision_pago);
request.is_remesa ="N";
while ( true ) {
request.nro_reg=c_facturas.nro_reg;
request.nro_fra=c_facturas.nro_fra;
request.nro_doc_pago=c_facturas.nro_doc_pago;
request.importe_total=c_facturas.importe_total;
if ( c_traspaso.nro_doc_pago != c_facturas.nro_doc_pago )
request.is_remesa ="S";
if (request.f_traspaso=="pago") {
traspaso_pago(nro_doc,nrolin,"D");
if (c_facturas.tipo_doc_pago == "1" ) {
fileData.writeln(request.linea);
fileRpt.writeln(request.lindoc);
nrolin++;
traspaso_pago(nro_doc,nrolin,"H");
Clave=c_traspaso.nro_doc_pago;
}
}
if (request.f_traspaso=="vto")
traspaso_vto(nro_doc,nrolin,"D");
fileData.writeln(request.linea);
fileRpt.writeln(request.lindoc);
nrolin++;
SumaTotal=parseFloat(c_facturas.importe_total)+parseFloat(SumaTotal);
if (!c_facturas.next())
break;
}
c_facturas.close();
request.nro_reg=c_traspaso.nro_reg;
request.nro_fra=c_traspaso.nro_fra;
request.nro_doc_pago=c_traspaso.nro_doc_pago;
request.importe_total=SumaTotal;
if (request.f_traspaso=="pago" && c_traspaso.tipo_doc_pago == "2" ) {
traspaso_pago(nro_doc,nrolin,"H");
Clave=c_traspaso.nro_doc_pago;
fileData.writeln(request.linea);
fileRpt.writeln(request.lindoc);
nrolin++;
}
if (request.f_traspaso=="vto") {
traspaso_vto(nro_doc,nrolin,"H");
Clave=c_traspaso.nro_reg_vto;
fileData.writeln(request.linea);
fileRpt.writeln(request.lindoc);
nrolin++;
}
// fileRpt.writeln('</TABLE>');
}
if (request.f_traspaso!="vto")
c_aptectasfra.close();
fileRpt.writeln('<HR>');
nro_doc++;
}
c_traspaso.close();
}
c_traspdocs.close();
fileRpt.writeln('</TABLE>');
request.lindoc="TOTALES DEBE : "+NroFormat(SumaDebe,NF11);
// request.lindoc=request.lindoc.substring(0,46)+NroFormat(SumaDebe,NF11)+NroFormat(SumaHaber,NF11)+""
fileRpt.writeln(request.lindoc);
request.lindoc="TOTALES HABER: "+NroFormat(SumaHaber,NF11);
fileRpt.writeln(request.lindoc);
fileRpt.writeln('<PRE>');
fileRpt.writeln('</FONT>');
fileRpt.writeln('</BODY>');
fileRpt.writeln('</HTML>');
fileRpt.close();
fileData.close();
}
function traspaso_pago(nro_doc,nrolin,tipoApte) {
var DocNro="";
var s_cta="";
s_banco=parseInt(c_traspaso.cod_banco)+"";
lon=s_banco.length;
request.d_cod_cta=request.cta_contable;
if (c_traspaso.tipo_doc_pago == "1" )
s_cta=request.pag_hpag;
if (c_traspaso.tipo_doc_pago == "2" )
s_cta=request.pag_htal;
s_lon=s_cta.length;
request.h_cod_cta=s_cta.substring(0,s_lon-lon)+s_banco;
s_lon=request.d_cod_cta.length;
if ( tipoApte == "H") {
DocNro=StringClip(false,request.nro_doc_pago)+"";
make_apte(nro_doc,request.h_cod_cta,request.d_cod_cta,"H",nrolin,request.importe_total,DocNro);
}
if ( tipoApte == "D") {
DocNro=StringClip(false,request.nro_fra)+" "+request.nro_reg.substring(4,10);
make_apte(nro_doc,request.d_cod_cta,request.h_cod_cta,"D",nrolin,request.importe_total,DocNro);
}
}
function traspaso_vto(nro_doc,nrolin,tipoApte) {
var DocNro="";
var s_cta="";
s_banco=parseInt(c_traspaso.cod_banco)+"";
lon=s_banco.length;
if (c_traspaso.tipo_doc_pago == "1" )
s_cta=request.vto_dpag;
if (c_traspaso.tipo_doc_pago == "2" )
s_cta=request.vto_dtal;
s_lon=s_cta.length;
request.d_cod_cta=s_cta.substring(0,s_lon-lon)+s_banco;
s_lon=request.vto_h.length;
request.h_cod_cta=request.vto_h.substring(0,s_lon-lon)+s_banco;
DocNro=StringClip(false,request.nro_doc_pago);
if ( tipoApte == "H") {
DocNro=StringClip(false,request.nro_doc_pago);
if ( request.is_remesa == "S" ) {
lon=c_traspaso.nro_reg_vto.length;
request.razon_social="REMESA "+c_traspaso.nro_reg_vto.substring(5,lon);
}
make_apte(nro_doc,request.h_cod_cta,request.d_cod_cta,"H",nrolin,request.importe_total,DocNro);
}
if ( tipoApte == "D") {
if ( request.is_remesa == "S" ) {
CursorTabla("pr","nif","=\'"+StringClip(true,c_facturas.nif)+"\'",false,false);
request.razon_social=StringClip(false,c_proveedores.razon_social);
c_proveedores.close();
}
make_apte(nro_doc,request.d_cod_cta,request.h_cod_cta,"D",nrolin,request.importe_total,DocNro);
DocNro=StringClip(false,request.nro_fra)+" "+request.nro_reg.substring(4,10);
}
}
function make_apte(nro_doc,cod_cta,c_cod_cta,tipo_apte,nl,Cantidad,DocNro) {
linea=" ";
request.linea=linea;
request.lindoc="";
cadena=parseInt(nro_doc)+"";
lon=cadena.length;
request.linea=request.linea.substring(0,p_nro_doc-lon)+cadena+linea;
cadena=parseInt(nl)+"";
lon=cadena.length;
request.linea=request.linea.substring(0,p_nro_lin-lon)+cadena+linea;
request.lindoc=StringClip(false,request.linea);
s_cadena=request.f_emision;
if (request.f_traspaso=="pago")
s_cadena=request.f_emision_pago;
cadena=datetoNString(s_cadena);
lon=cadena.length;
request.linea=request.linea.substring(0,p_f_cont-lon)+cadena+linea;
request.linea=request.linea.substring(0,p_f_emis-lon)+cadena+linea;
request.lindoc=request.lindoc+" "+s_cadena;
cadena=StringClip(false,c_traspaso.cod_centro);
request.lindoc=request.lindoc+" "+cadena;
lon=cadena.length;
request.linea=request.linea.substring(0,p_centro-lon)+cadena+linea;
if (request.f_traspaso=="gasto")
cadena=StringClip(false,c_aptectasfra.cod_cta);
if (request.f_traspaso=="pago")
cadena=StringClip(false,cod_cta)+"";
if (request.f_traspaso=="vto")
cadena=StringClip(false,cod_cta)+"";
request.lindoc=request.lindoc+" "+cadena;
lon=cadena.length;
request.linea=request.linea.substring(0,p_cta-lon)+cadena+linea;
if (request.f_traspaso=="gasto")
cadena=c_aptectasfra.clave+"";
if (request.f_traspaso=="pago")
cadena=request.f_clave+"";
if (request.f_traspaso=="vto")
cadena=request.f_clave+"";
request.lindoc=request.lindoc+" "+cadena;
clave=cadena;
if (request.f_traspaso=="gasto") {
nro=c_aptectasfra.importe;
tipo_apte=c_aptectasfra.tipo_apte;
} else {
nro=Cantidad;
}
if ( c_traspaso.tipo_doc_pago == "1" )
cadDoc="P/";
if ( c_traspaso.tipo_doc_pago == "2" )
cadDoc="T/";
if ( nro < 0 ) {
nro=nro*-1;
if (request.f_traspaso=="pago" && tipo_apte == "D")
cadDoc="";
if ( tipo_apte == "D" )
tipo_apte="H";
else
tipo_apte="D";
}
if (tipo_apte == "H") {
SumaHaber=SumaHaber+nro;
request.lindoc=request.lindoc+" "+NroFormat(nro,NF9)+" ";
} else {
SumaDebe=SumaDebe+nro;
request.lindoc=request.lindoc+" "+NroFormat(nro,NF9)+" ";
};
cadena=tipo_apte;
lon=cadena.length;
request.linea=request.linea.substring(0,p_tipo_apte-lon)+cadena+linea;
cadena=NroUnformat(NroFormat(nro,NF9))+"";
lon=cadena.length;
request.linea=request.linea.substring(0,p_importe-lon)+cadena+linea;
lon=clave.length;
request.linea=request.linea.substring(0,p_clave-lon)+clave+linea;
if (request.f_traspaso=="gasto") {
cadena=StringClip(false,c_aptectasfra.concepto);
// cadena=StringClip(false,c_traspaso.nro_fra)+" "+c_traspaso.nro_reg.substring(4,10)+" "+StringClip(false,request.razon_social);
}
if (request.f_traspaso=="pago" && tipo_apte == "H")
cadena=cadDoc+DocNro+" "+StringClip(false,request.razon_social);
if (request.f_traspaso=="pago" && tipo_apte == "D") {
// cadena=StringClip(false,c_aptectasfra.concepto);
cadena=DocNro+StringClip(false,request.razon_social);
}
if (request.f_traspaso=="vto" && tipo_apte == "D")
cadena=cadDoc+DocNro+" "+StringClip(false,request.razon_social);
if (request.f_traspaso=="vto" && tipo_apte == "H") {
if ( request.is_remesa == "S" )
cadena=StringClip(false,request.razon_social);
else
cadena=cadDoc+DocNro+" "+StringClip(false,request.razon_social);
}
lon=30; // lon=cadena.length;
s_cadena=cadena+linea;
request.lindoc=request.lindoc+" "+s_cadena.substring(0,lon);
request.linea=request.linea.substring(0,p_concepto-lon)+cadena.substring(0,lon)+linea;
if (request.f_traspaso=="gasto") {
s_cadena=" ";
cadena=s_cadena;
}
else {
s_cadena=datetoString(c_traspaso.vto_pago);
cadena=datetoNString(s_cadena);
}
request.lindoc=request.lindoc+" "+s_cadena;
lon=cadena.length;
request.linea=request.linea.substring(0,p_vto-lon)+cadena+linea;
cadena=StringClip(false,c_cod_cta);
lon=cadena.length;
//texto="p_contracta="+p_contracta+" lon="+lon+" c_cod_cta="+c_cod_cta
//debug(texto)
//debug(request.linea)
request.lindoc=request.lindoc+" "+cadena;
// if (request.f_traspaso=="pago" && tipo_apte == "H" && cod_cta.substring(0,2) != "41")
// lon=lon-4;
request.linea=request.linea.substring(0,p_contracta-lon)+cadena;
//debug(request.linea)
}

512
l_traspaso.js Normal file
View File

@ -0,0 +1,512 @@
//////////////////////////////////////
// //
// JavaScript Functions //
// //
//////////////////////////////////////
function wrtraspaso(text){
// writeln("w_outtraspaso.document.write('"+text+"\\n');");
fileRpt.writeln(text);
}
function chk_traspaso() {
var query;
c_query = database.cursor("select * FROM traspaso WHERE uid=\'" + request.uid+ "\'");
if (c_query.next()) {
request.criterio=StringClip(false,c_query.criterio);
request.f_traspaso=StringClip(false,c_query.f_traspaso);
request.f_emision=StringClip(false,c_query.f_emision);
request.f_nro_doc=StringClip(false,c_query.f_nro_doc);
request.sel_order=StringClip(false,c_query.sel_order);
writeln(' alert("\\r Existe un Traspaso de '+request.f_traspaso+' Pendientes de Confirmación !!!"); ');
request.opt_traspaso="true";
}
c_query.close();
if (request.opt_traspaso)
return true
else
return false
}
function insertaTrasp() {
status=database.execute('INSERT INTO traspaso(' +
' uid,' +
' sel_order,'+
' criterio,'+
' f_traspaso,'+
' f_emision,'+
' f_nro_doc ) VALUES ("' + request.uid+ '","' +
request.sel_order + '","'+
request.criterio + '","'+
request.f_traspaso + '","'+
request.f_emision + '","'+
request.f_nro_doc + '")');
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect(addClient('error.html?alert=14'));
}
}
function report_traspaso() {
client.is_trans=true;
database.beginTransaction();
insertaTrasp();
out_traspaso();
database.commitTransaction();
client.is_trans=false;
}
function rpt_traspaso_Doc() {
writeln('w_carta=window.open("'+urlDoc+'","w_traspaso","toolbar=yes,directories=no,menubar=yes,status=no,scrollbars=yes,resizable=yes,width=600,height=500");');
}
function rpt_traspaso_Data() {
writeln('w_carta=window.open("'+urlData+'","w_traspaso","toolbar=yes,directories=no,menubar=yes,status=no,scrollbars=yes,resizable=yes,width=600,height=500");');
}
function cleanup_traspaso() {
// Borramos en tabla de pagos datos del usuario
status=database.execute("DELETE FROM traspaso WHERE uid=\'" + request.uid+ "\'");
return;
}
function out_traspaso() {
var Clave="-";
var SumaTotal=0;
var fileRpt=new File(nomDoc);
fileRpt.open("w");
var fileData=new File(nomData);
fileData.open("w");
fileRpt.writeln('<HTML>');
fileRpt.writeln('<HEAD></HEAD>');
fileRpt.writeln('<BODY>');
fileRpt.writeln('<B><I><CENTER> Traspaso de Facturas - '+request.f_traspaso+' - </B></I>');
if (request.f_traspaso=="gasto")
fileRpt.writeln('<FONT SIZE=1>');
else
fileRpt.writeln('<FONT SIZE=1>');
fileRpt.writeln('<PRE> ');
fileRpt.writeln('<HR>');
if (request.f_traspaso=="gasto")
fileRpt.writeln('<B>N.Doc. Línea Fecha Centro Cuenta Cv. DEBE HABER C o n c e p t o F. Vto. Contrap.</B>');
else {
fileRpt.writeln('<TABLE ALIGN="CENTER" BORDER=0>');
fileRpt.writeln('<B>N.Doc. Línea Fecha Centro Cuenta Cv. DEBE HABER C o n c e p t o F. Vto. Contrap.</B>');
}
fileRpt.writeln('<HR>');
linea=" ";
// c_traspaso = database.cursor("SELECT * FROM traspaso WHERE uid="+ request.uid+" ORDER BY nro_reg ");
var nlin=1
var nro_doc=NroUnformat(request.f_nro_doc);
while (c_traspdocs.next()) {
if (request.f_traspaso=="pago")
c_traspaso = database.cursor("SELECT * FROM facturas,proveedores WHERE facturas.nif=proveedores.nif "+
" and nro_doc_pago='"+c_traspdocs.nro_doc_pago+"' "+
" ORDER BY " + request.sel_order);
if (request.f_traspaso=="gasto")
c_traspaso = database.cursor("SELECT * FROM facturas,proveedores WHERE facturas.nif=proveedores.nif "+
" and nro_reg='"+c_traspdocs.nro_reg+"' "+
" ORDER BY " + request.sel_order);
if (request.f_traspaso=="vto")
c_traspaso = database.cursor("SELECT * FROM facturas,proveedores WHERE facturas.nif=proveedores.nif "+
" and nro_reg_vto='"+c_traspdocs.nro_reg_vto+"' "+
" ORDER BY " + request.sel_order);
while (c_traspaso.next()) {
request.razon_social=c_traspaso.razon_social;
if ( request.f_traspaso=="pago" && Clave == c_traspaso.nro_doc_pago )
continue;
if ( request.f_traspaso=="vto" && Clave == c_traspaso.nro_reg_vto )
continue ;
jusnum="";
nrolin=1;
if (request.f_traspaso!="vto")
CursorTabla("acf","nro_reg","=\'"+c_traspaso.nro_reg+"\' order by nro_lin ",false,"");
if (request.f_traspaso=="gasto") {
fileRpt.writeln('<TABLE ALIGN="CENTER" BORDER=0>');
while (c_aptectasfra.next()) {
make_apte(nro_doc,"",StringClip(false,c_traspaso.cta_contable),"",nrolin,0,jusnum,c_aptectasfra.tipoapte);
// if ( nrolin+1 > request.maxLins ) {
// skipTopPage(nrolin,request.maxLins);
// nrolin=0;
// }
if (c_aptectasfra.tipoapte != "I1" ||
c_aptectasfra.tipoapte != "I2" ||
c_aptectasfra.tipoapte != "I3" )
fileData.writeln(request.linea);
fileRpt.writeln(request.lindoc);
nrolin++;
if ( jusnum == "" )
jusnum="0";
}
fileRpt.writeln('</TABLE>');
} else {
if (request.f_traspaso!="vto")
c_aptectasfra.next();
// fileRpt.writeln('<TABLE ALIGN="CENTER" BORDER=0>');
if (request.f_traspaso=="pago")
CursorTabla("fa","nro_doc_pago","=\'"+c_traspaso.nro_doc_pago+"\'",true,"");
if (request.f_traspaso=="vto")
CursorTabla("fa","nro_reg_vto","=\'"+c_traspaso.nro_reg_vto+"\'",true,"");
SumaTotal=0;
request.cta_contable=c_traspaso.cta_contable;
request.f_emision_pago=datetoString(c_traspaso.f_emision_pago);
request.is_remesa ="N";
while ( true ) {
request.nro_reg=c_facturas.nro_reg;
request.nro_fra=c_facturas.nro_fra;
request.nro_doc_pago=c_facturas.nro_doc_pago;
request.importe_total=c_facturas.importe_total;
if ( c_traspaso.nro_doc_pago != c_facturas.nro_doc_pago )
request.is_remesa ="S";
if (request.f_traspaso=="pago") {
traspaso_pago(nro_doc,nrolin,"D");
if (c_facturas.tipo_doc_pago == "1" ) {
fileData.writeln(request.linea);
fileRpt.writeln(request.lindoc);
nrolin++;
traspaso_pago(nro_doc,nrolin,"H");
Clave=c_traspaso.nro_doc_pago;
}
}
if (request.f_traspaso=="vto")
traspaso_vto(nro_doc,nrolin,"D");
fileData.writeln(request.linea);
fileRpt.writeln(request.lindoc);
nrolin++;
SumaTotal=parseFloat(c_facturas.importe_total)+parseFloat(SumaTotal);
if (!c_facturas.next())
break;
}
c_facturas.close();
request.nro_reg=c_traspaso.nro_reg;
request.nro_fra=c_traspaso.nro_fra;
request.nro_doc_pago=c_traspaso.nro_doc_pago;
request.importe_total=SumaTotal;
if (request.f_traspaso=="pago" && c_traspaso.tipo_doc_pago == "2" ) {
traspaso_pago(nro_doc,nrolin,"H");
Clave=c_traspaso.nro_doc_pago;
fileData.writeln(request.linea);
fileRpt.writeln(request.lindoc);
nrolin++;
}
if (request.f_traspaso=="vto") {
traspaso_vto(nro_doc,nrolin,"H");
Clave=c_traspaso.nro_reg_vto;
fileData.writeln(request.linea);
fileRpt.writeln(request.lindoc);
nrolin++;
}
// fileRpt.writeln('</TABLE>');
}
if (request.f_traspaso!="vto")
c_aptectasfra.close();
fileRpt.writeln('<HR>');
nro_doc++;
}
c_traspaso.close();
}
c_traspdocs.close();
fileRpt.writeln('</TABLE>');
request.lindoc="TOTALES DEBE : "+NroFormat(SumaDebe,NF11);
// request.lindoc=request.lindoc.substring(0,46)+NroFormat(SumaDebe,NF11)+NroFormat(SumaHaber,NF11)+""
fileRpt.writeln(request.lindoc);
request.lindoc="TOTALES HABER: "+NroFormat(SumaHaber,NF11);
fileRpt.writeln(request.lindoc);
fileRpt.writeln('<PRE>');
fileRpt.writeln('</FONT>');
fileRpt.writeln('</BODY>');
fileRpt.writeln('</HTML>');
fileRpt.close();
fileData.close();
}
function traspaso_pago(nro_doc,nrolin,tipoApte) {
var DocNro="";
var s_cta="";
s_banco=parseInt(c_traspaso.cod_banco)+"";
lon=s_banco.length;
request.d_cod_cta=request.cta_contable;
if (c_traspaso.tipo_doc_pago == "1" )
s_cta=request.pag_hpag;
if (c_traspaso.tipo_doc_pago == "2" )
s_cta=request.pag_htal;
s_lon=s_cta.length;
request.h_cod_cta=s_cta.substring(0,s_lon-lon)+s_banco;
s_lon=request.d_cod_cta.length;
if ( tipoApte == "H") {
DocNro=StringClip(false,request.nro_doc_pago)+"";
make_apte(nro_doc,request.h_cod_cta,request.d_cod_cta,"H",nrolin,request.importe_total,DocNro,jusnum,"");
}
if ( tipoApte == "D") {
DocNro=StringClip(false,request.nro_fra)+" "+request.nro_reg.substring(4,10);
make_apte(nro_doc,request.d_cod_cta,request.h_cod_cta,"D",nrolin,request.importe_total,DocNro,jusnum,"");
}
}
function traspaso_vto(nro_doc,nrolin,tipoApte) {
var DocNro="";
var s_cta="";
s_banco=parseInt(c_traspaso.cod_banco)+"";
lon=s_banco.length;
if (c_traspaso.tipo_doc_pago == "1" )
s_cta=request.vto_dpag;
if (c_traspaso.tipo_doc_pago == "2" )
s_cta=request.vto_dtal;
s_lon=s_cta.length;
request.d_cod_cta=s_cta.substring(0,s_lon-lon)+s_banco;
s_lon=request.vto_h.length;
request.h_cod_cta=request.vto_h.substring(0,s_lon-lon)+s_banco;
DocNro=StringClip(false,request.nro_doc_pago);
if ( tipoApte == "H") {
DocNro=StringClip(false,request.nro_doc_pago);
if ( request.is_remesa == "S" ) {
lon=c_traspaso.nro_reg_vto.length;
request.razon_social="REMESA "+c_traspaso.nro_reg_vto.substring(5,lon);
}
make_apte(nro_doc,request.h_cod_cta,request.d_cod_cta,"H",nrolin,request.importe_total,DocNro,jusnum,"");
}
if ( tipoApte == "D") {
if ( request.is_remesa == "S" ) {
CursorTabla("pr","nif","=\'"+StringClip(true,c_facturas.nif)+"\'",false,false);
request.razon_social=StringClip(false,c_proveedores.razon_social);
c_proveedores.close();
}
make_apte(nro_doc,request.d_cod_cta,request.h_cod_cta,"D",nrolin,request.importe_total,DocNro,jusnum,"");
DocNro=StringClip(false,request.nro_fra)+" "+request.nro_reg.substring(4,10);
}
}
function make_apte(nro_doc,cod_cta,c_cod_cta,tipo_apte,nl,Cantidad,DocNro,jusnum,tipoapte) {
make_lindoc(nro_doc,cod_cta,c_cod_cta,tipo_apte,nl,Cantidad,DocNro,jusnum,tipoapte);
if (tipoapte != "I1" || tipoapte != "I2" || tipoapte != "I3" )
make_linea(nro_doc,cod_cta,c_cod_cta,tipo_apte,nl,Cantidad,DocNro,jusnum,tipoapte);
}
function make_lindoc(nro_doc,cod_cta,c_cod_cta,tipo_apte,nl,Cantidad,DocNro,jusnum,tipoapte) {
linea=" ";
request.lindoc="";
// cadena=parseInt(nro_doc)+"";
cadDoc="";
if ( c_traspaso.tipo_doc_pago == "1" )
cadDoc="P/";
if ( c_traspaso.tipo_doc_pago == "2" )
cadDoc="T/";
if (request.f_traspaso=="gasto") {
cadena=StringClip(false,c_aptectasfra.concepto);
}
// Una "P" delante del nro_doc ahora DocNro
request.lindoc=cadDoc+DocNro+" ";
cadena=parseInt(nl)+"";
request.lindoc=request.lindoc+cadena;
// Fecha de documento
s_fechadoc=request.f_emision;
if (request.f_traspaso=="pago")
s_fechadoc=request.f_emision_pago;
cadena=datetoNString(s_fechadoc);
lon=cadena.length;
request.lindoc=request.lindoc+" "+s_fechadoc;
s_fechadoc=cadena;
// Cod. Centro para el listado
cadena=StringClip(false,c_traspaso.cod_centro);
request.lindoc=request.lindoc+" "+cadena;
// Cod. Cta.
if (request.f_traspaso=="gasto")
s_cta=StringClip(false,c_aptectasfra.cod_cta);
if (request.f_traspaso=="pago")
s_cta=StringClip(false,cod_cta)+"";
if (request.f_traspaso=="vto")
s_cta=StringClip(false,cod_cta)+"";
request.lindoc=request.lindoc+" "+s_cta;
lon=s_cta.length;
// Clave
if (request.f_traspaso=="gasto")
cadena=c_aptectasfra.clave+"";
if (request.f_traspaso=="pago")
cadena=request.f_clave+"";
if (request.f_traspaso=="vto")
cadena=request.f_clave+"";
request.lindoc=request.lindoc+" "+cadena;
clave=cadena;
// Importe
if (request.f_traspaso=="gasto") {
nro=c_aptectasfra.importe;
tipo_apte=c_aptectasfra.tipo_apte;
} else {
nro=Cantidad;
}
if ( nro < 0 ) {
nro=nro*-1;
if (request.f_traspaso=="pago" && tipo_apte == "D")
cadDoc="";
if ( tipo_apte == "D" )
tipo_apte="H";
else
tipo_apte="D";
}
if (tipo_apte == "H") {
SumaHaber=SumaHaber+nro;
request.lindoc=request.lindoc+" "+NroFormat(nro,NF9)+" ";
} else {
SumaDebe=SumaDebe+nro;
request.lindoc=request.lindoc+" "+NroFormat(nro,NF9)+" ";
};
cadena=NroUnformat(NroFormat(nro,NF9))+"";
// Concepto para el listado
if (request.f_traspaso=="gasto") {
cadena=StringClip(false,c_aptectasfra.concepto);
}
if (request.f_traspaso=="pago" && tipo_apte == "H")
cadena=cadDoc+DocNro+" "+StringClip(false,request.razon_social);
if (request.f_traspaso=="pago" && tipo_apte == "D") {
cadena=DocNro+StringClip(false,request.razon_social);
}
if (request.f_traspaso=="vto" && tipo_apte == "D")
cadena=cadDoc+DocNro+" "+StringClip(false,request.razon_social);
if (request.f_traspaso=="vto" && tipo_apte == "H") {
if ( request.is_remesa == "S" )
cadena=StringClip(false,request.razon_social);
else
cadena=cadDoc+DocNro+" "+StringClip(false,request.razon_social);
}
lon=30; // lon=cadena.length;
s_cadena=cadena+linea;
request.lindoc=request.lindoc+" "+s_cadena.substring(0,lon);
// Vto.
if (request.f_traspaso=="gasto") {
s_cadena=" ";
cadena=s_cadena;
}
else {
s_cadena=datetoString(c_traspaso.vto_pago);
cadena=datetoNString(s_cadena);
}
request.lindoc=request.lindoc+" "+s_cadena;
lon=cadena.length;
// Contrapartida para el listado
cadena=StringClip(false,c_cod_cta);
lon=cadena.length;
request.lindoc=request.lindoc+" "+cadena;
}
function make_linea(nro_doc,cod_cta,c_cod_cta,tipo_apte,nl,Cantidad,DocNro,jusnum,tipoapte) {
linea=" ";
carsep="|";
request.linea="";
// apteid, asient, diario, moneda, cambio
request.linea="0"+carsep+"DG"+carsep+"PTA"+carsep+"1.0"+carsep;
cadena=StringClip(false,c_traspaso.cod_centro);
// centro de coste, seccion, juser
request.linea=request.linea+cadena+carsep+"A"+carsep+"A"+carsep+jusnum+carsep;
request.linea=request.linea+"P"+carsep;
cadDoc="";
if ( c_traspaso.tipo_doc_pago == "1" )
cadDoc="P/";
if ( c_traspaso.tipo_doc_pago == "2" )
cadDoc="T/";
if (request.f_traspaso=="gasto") {
cadena=StringClip(false,c_aptectasfra.concepto);
}
request.linea=request.linea+cadDoc+DocNro+carsep;
// Fecha de documento
s_fechadoc=request.f_emision;
if (request.f_traspaso=="pago")
s_fechadoc=request.f_emision_pago;
cadena=datetoNString(s_fechadoc);
lon=cadena.length;
request.linea=request.linea+cadena+carsep;
s_fechadoc=cadena;
// Cod. Cta.
if (request.f_traspaso=="gasto")
s_cta=StringClip(false,c_aptectasfra.cod_cta);
if (request.f_traspaso=="pago")
s_cta=StringClip(false,cod_cta)+"";
if (request.f_traspaso=="vto")
s_cta=StringClip(false,cod_cta)+"";
lon=s_cta.length;
request.linea=request.linea+s_cta.substring(0,3)+"."+s_cta.substring(4,lon)+carsep+carsep;
// Concepto
if ( c_traspaso.tipo_doc_pago == "1" )
cadDoc="P/";
if ( c_traspaso.tipo_doc_pago == "2" )
cadDoc="T/";
if (request.f_traspaso=="gasto") {
cadena=StringClip(false,c_aptectasfra.concepto);
}
if (request.f_traspaso=="pago" && tipo_apte == "H")
cadena=cadDoc+DocNro+" "+StringClip(false,request.razon_social);
if (request.f_traspaso=="pago" && tipo_apte == "D") {
cadena=DocNro+StringClip(false,request.razon_social);
}
if (request.f_traspaso=="vto" && tipo_apte == "D")
cadena=cadDoc+DocNro+" "+StringClip(false,request.razon_social);
if (request.f_traspaso=="vto" && tipo_apte == "H") {
if ( request.is_remesa == "S" )
cadena=StringClip(false,request.razon_social);
else
cadena=cadDoc+DocNro+" "+StringClip(false,request.razon_social);
}
request.linea=request.linea+cadena+carsep;
// Importe
if (request.f_traspaso=="gasto") {
nro=c_aptectasfra.importe;
tipo_apte=c_aptectasfra.tipo_apte;
} else {
nro=Cantidad;
}
cadena=NroUnformat(NroFormat(nro,NF9))+"";
if ( tipo_apte == "D" )
request.linea=request.linea+cadena+carsep+carsep;
if ( tipo_apte == "H" )
request.linea=request.linea+carsep+cadena+carsep;
// Contrapartida nula aptes. en tabla
request.linea=request.linea+carsep;
// Fecha valor, sistem
request.linea=request.linea+s_fechadoc+carsep+"A"+carsep+"0"+carsep+"0"+carsep;
// Tipo documento
if ( s_cta.substring(0,1) == "2" )
request.linea=request.linea+"I"+carsep;
else
request.linea=request.linea+"R"+carsep+"N"+carsep;
// Código de Tercero cta_contable
request.linea=request.linea+c_traspaso.cta_contable+carsep;
tipIVA="";
if (tipoapte == "P1"){
if ( c_traspaso.iva_1 == "16")
tipIVA="RE"
request.linea=request.linea+tipIVA+carsep+"1"+carsep;
}
if (tipoapte == "P2"){
if ( c_traspaso.iva_2 == "7" )
tipIVA="OR"
request.linea=request.linea+tipIVA+carsep+"1"+carsep;
}
if (tipoapte == "P3"){
if ( c_traspaso.iva_3 == "4" )
tipIVA="SR"
request.linea=request.linea+tipIVA+carsep+"1"+carsep;
}
if (request.f_traspaso=="gasto")
cadena=c_aptectasfra.clave+"";
if (request.f_traspaso=="pago")
cadena=request.f_clave+"";
if (request.f_traspaso=="vto")
cadena=request.f_clave+"";
// Vto.
if (request.f_traspaso=="gasto") {
s_cadena=" ";
cadena=s_cadena;
}
else {
s_cadena=datetoString(c_traspaso.vto_pago);
cadena=datetoNString(s_cadena);
}
lon=cadena.length;
request.linea=request.linea+cadena+linea;
// Contrapartida para el listado
cadena=StringClip(false,c_cod_cta);
lon=cadena.length;
request.linea=request.linea+cadena;
//texto="p_contracta="+p_contracta+" lon="+lon+" c_cod_cta="+c_cod_cta
//debug(texto)
//debug(request.linea)
//debug(request.linea)
}

45
logged_out.html Normal file
View File

@ -0,0 +1,45 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Logged Out</TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/4.0b1 (Win95; I) [Netscape]">
</HEAD>
<BODY BACKGROUND="images/BG.jpg">
<CENTER><P><BR>
<BR>
<SERVER>
if (request.alert) {
if (request.alert == 0 )
writeln('<H1><B><BLINK><FONT COLOR="#FF0000"> ¡¡¡ Acceso No Permitido a los Datos !!!!</FONT></H1></BLINK> </B>');
}
</SERVER>
<BR></P></CENTER>
<CENTER><TABLE BORDER=4 WIDTH="100" HEIGHT="100" BGCOLOR="#FFFFFF" >
<TR>
<TD align=center colspan=3>
<DL>
<DT><A HREF="http://ctasapagar.malaga.sando.es"><IMG SRC="images/sand2new.gif" ALT="Construcciones Sando" BORDER=0 HEIGHT=117 WIDTH=424 ALIGN=RIGHT></A>
<A HREF="http://ctasapagar.malaga.sando.es">&nbsp;</A></DT>
</DL>
</TD>
</TR>
</TABLE></CENTER>
<H1 ALIGN=CENTER><FONT COLOR="#FF0080">Cuentas a Pagar</FONT></H1>
<CENTER><P><BR>
<BR>
<IMG SRC="images/linea.gif" HEIGHT=20 WIDTH=500 ALIGN=BOTTOM>&nbsp;</P></CENTER>
<H1 ALIGN=CENTER>Debe <A HREF="http://ctasapagar.malaga.sando.es/Ctas_a_Pagar/initial.html" target="_top">Alojarse
en</A> el sistema de nuevo.</H1>
<CENTER><DT ALIGN=CENTER>&nbsp;</DT></CENTER>
<CENTER><DT><A HREF="http://ctasapagar.malaga.sando.es/Ctas_a_Pagar/initial.html"><IMG SRC="images/click.gif" HEIGHT=30 WIDTH=68></A></DT></CENTER>
</BODY>
</HTML>

80
login.html Normal file
View File

@ -0,0 +1,80 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Login</TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (WinNT; I) [Netscape]">
</HEAD>
</SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<BODY>
<P><!-- application: -->
<!-- version: 1.0 -->
<!-- company name: -->
<!-- filename: login.html -->
<!-- description: looks up user name and password from initial.html -->
<!-- in db. if not found, return to login screen, -->
<!-- else set cookies and go on to app. -->
<!-- ==================================================================== -->
<!-- -->
<!-- ==================================================================== -->
<!-- Look up user in the database. If found, set cookies so s/he won't have
to log in again and redirect to menu. If not found, try logging in
again. -->
<SERVER>
var baseHtml="";
if (request.prevPage)
client.prevPage = request.prevPage;
checkPrevPage("login.html");
//client.ViewFkey=request.ViewFkey;
//client.FrameType=request.FrameType;
client.MsgScroll=request.MsgScroll;
<!-- look up user -->
login = database.cursor("select id,firstname,lastname,def_category,acl from user where "+
"active='Y' and login='"+escQuote(request.username)+
"' and password='"+escQuote(request.password)+"'");
firstname = null;
lastname = null;
user_found = false;
<!-- assumes login/password pairs are unique -->
request.uid=0;
if (login.next()) {
client.id = login.id;
request.uid= client.id;
firstname = login.firstname;
lastname = login.lastname;
client.username = login.username;
client.fullname = login.fullname;
client.def_category=login.def_category;
client.acl = login.acl;
client.def_project = login.def_project;
client.objeto="";
client.trans=false;
setLoggedIn();
user_found = true;
}
login.close();
<!-- set cookies -->
client.username = request.username;
client.fullname = firstname+" "+lastname;
LoadParametros();
<!-- if user not found, go back to login form, else go to main screen -->
if (!user_found)
redirect("initial.html?ipw=1");
else {
<!-- load frames: button bar and hours entry screen -->
baseHtml="FrameType="+request.FrameType+"&ViewFkey="+request.ViewFkey+"&uid="+request.uid
redirect("ctasapagar.html?"+baseHtml);
}
</SERVER>
</P>
</BODY>
</HTML>

75
logout.html Normal file
View File

@ -0,0 +1,75 @@
<HEAD>
<!-- application: Ctas a Pagar -->
<!-- version: 1.0 -->
<!-- company name: AdmiSys -->
<!-- filename: logout.html -->
<!-- description: destroy user's identifying cookies and return -->
<!-- to login screen -->
<server>
/*
*/
</server>
<server>
setLoggedOut();
client.id = null;
client.username = null;
client.prevPage = null;
client.fullname = null;
client.def_category = null;
client.def_project = null;
client.acl=null;
client.FrameType=null;
client.expiration(0);
client.prevPage = "logout.tml";
client.es_inicio=0;
client.ViewFkey = null;
client.MsgScroll = null;
client.objeto = ""
client.trans=null;
UnLoadParametros();
<!-- this doesn't seem to do anything! -->
<!-- client.destroy(); -->
if(database.connected)
database.disconnect();
//if (request.bb) {
// write("<SCRIPT LANGUAGE='JavaScript'>top.close();</SCRIPT>")
// redirect("go_page.html?page=initial.html?ipw=1");
// from button bar, already cleared frames
// chk_login();
// redirect("logged_out.html");
//<!-- redirect("initial.html"); -->
//}
//else {
// redirect("logged_out.html");
//}
</server>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SERVER>
<!--
writeln("<SCRIPT LANGUAGE='JavaScript'>")
writeln("function Go_Location() {")
if (request.alert)
writeln('parent.location.href=entorno.DirBase+"/logged_out.html?alert='+request.alert+'"');
else
writeln('parent.location.href=entorno.DirBase+"/logged_out.html"')
writeln('top.close()');
writeln("}")
writeln("</SCRIPT>")
//-->
</SERVER>
</HEAD>
<BODY ONLOAD="Go_Location()" >
</BODY>
</HEAD>
</HTML>

335
nroletra.js Normal file
View File

@ -0,0 +1,335 @@
// //
// JavaScript Functions //
// //
//////////////////////////////////////
// Función para convertir un nro. en letra
//
// La llamada a esta función es del modo siguiente:
//
// nro_letra(nro, cod_len, cod_gen, cod_mon, car_pad, lon_l1, lon_l2)
// return num_let
//
// (*) nro es el float que contiene el nro. a transcribir.
// (*) cod_len es el código de la lengua en la que se transcribe nro
// (3 dígitos) ej: "spa" para nuestra lengua.
// (*) cod_gen es el género "m" masculino o "f" femenino.
// cod_mon es el código de la moneda ( 4 dígitos). [ej: "pts"]
// car_pad es el caracter que se usa para relleno ( caso de cheques)
// lon_l1 es la longitud de la primera cadena de caracteres que se
// concatena con la segunda en una para el return
// lon_l2 es la longitud de la segunda cadena que se prepara para
// el programa que llama a este módulo
// num_let es la cadena que se manipula y devuelve con el texto del
// nro transcrito y las manipulaciones solicitadas por el
// resto de los argumentos.
//
function nro_letra(nro_i, cod_len, cod_gen, cod_mon, car_pad, lon_l1, lon_l2) {
// var nro_i=0; // Nro. a escribir
// var cod_len=""; // Código de lengua
// var cod_gen=""; // Código ( m / f) género para cientos
// var cod_mon=""; // Código de moneda
// var car_pad=""; // Caracter para usar de relleno
// var lon_l1=0; // Long de la línea uno
// var lon_l2=0; // Long de la línea dos
var nro_let="";
var nro=parseFloat(nro_i);
//car_pad="*"
//lon_l1=80
//cod_len="spa"
//cod_gen="m"
tx_cent="";
tx_dece="";
tx_und="";
tx_mll="";
txletmll="";
txletmil="";
if ( nro+0 == 0 ) {
return false;
}
var s_nro=nro+"";
var lonNro=s_nro.length;
var pos=s_nro.indexOf(car_dec);
// if (pos == -1) {
// var s_entera=s_nro;
// var s_decimal="0";
// } else {
// var s_entera = s_nro.substring(0,pos);
// var s_decimal = s_nro.substring(pos+1,longNro);
// }
//debug(s_entera);
// if ( parseInt(s_entera) > 0 )
analiza_num(s_nro,cod_mon,car_pad, lon_l1, lon_l2); // Análisis nro y trad.
// if ( parseInt(s_decimal) > 0 && pos > 0 ) {
// nro_let=num_let;
// analiza_num(s_decimal); // Análisis del nro y trad.
// num_let=nro_let+" con "+num_let;
// }
if (num_let.length == 0 ) { return "" }
// num_let=num_let+cod_mon; // pone moneda y mayuscula
return true
}
function analiza_num(s_num,cod_mon,car_pad, lon_l1, lon_l2) {
var nro_let="";
var s_nro="";
var s_numero=s_num+"";
var lonNro=s_numero.length;
if ( lonNro < 3 ) {
parseCent(s_numero,1,1);
num_let=tx_cent+" "+tx_dece+tx_und+" ";
return;
}
var n_centenas=parseInt(lonNro/3);
var n_ope=n_centenas*3;
var n_ini=0;
if (n_centenas == 0 )
n_centenas=1;
if ( n_ope < lonNro ) {
n_centenas++;
n_fin=lonNro-n_ope;
} else
n_fin=n_ini+3;
for ( var i=0; i < n_centenas ; i++ ) {
s_nro=s_numero.substring(n_ini,n_fin);
parseCent(s_nro,n_centenas,n_centenas-i);
if ( n_centenas-i == 2 && s_nro != "000")
txletmil=" "+let_mil;
else
txletmil="";
nro_let=nro_let+" "+tx_cent+" "+tx_dece+tx_und+txletmil;
if (parseInt(s_nro) > 0 ) {
parseMil(n_centenas-i,s_nro)
if (s_nro == "1" )
nro_let=let_un+" "+txletmll;
else {
nro_let=nro_let+" "+txletmll;
}
}
n_ini=n_fin;
n_fin=n_ini+3;
}
num_let=nro_let+" ";
num_let=num_let+" "+cod_mon;
nro_let=num_let;
num_let=num_let+linPad;
num_let2=linPad;
lonNro=nro_let.length;
if ( lonNro > LongLine) {
var pos=LongLine;
while (pos > 0) {
var s_char=nro_let.substring(pos-1,pos)
if ( s_char == " " )
break;
pos--;
}
if ( pos > 0 ) {
num_let=nro_let.substring(0,pos)+linPad;
num_let2=nro_let.substring(pos,lonNro)+linPad;
}
}
num_let=num_let.substring(0,lon_l1);
num_let2=num_let2.substring(0,lon_l2);
return;
}
function parseCent(s_nro,n_cents,p_cents) {
var nro_flt=parseFloat(s_nro);
var cad_nro = nro_flt+"";
var lon = cad_nro.length;
var cadena="";
var n_c=0;
tx_cent="";
tx_dece="";
tx_und="";
if (cad_nro == "000" ) return
if (cad_nro == "100" ) {
tx_cent = mat_ce_1;
return
}
if ( lon == 3 ) { // Centenas
var n_c=cad_nro.substring(0,1);
var n_d=cad_nro.substring(1,2);
var n_u=cad_nro.substring(2,3);
}
if ( lon == 2 ) { // Decenas
var n_c="0";
var n_d=cad_nro.substring(0,1);
var n_u=cad_nro.substring(1,2);
}
if ( lon == 1 ) { // Unidades
var n_c="0";
var n_d="0";
var n_u=cad_nro.substring(0,1);
}
if ( n_c > 0 ) {
eval("tx_cent = mat_ce_"+n_c);
if ( n_c > 1 && n_c != 5 )
tx_cent= tx_cent+let_ciens
}
if ( n_c == 1 ) { tx_cent = tx_cent+let_plus100; };
if ( n_d > 0 ) {
if ( n_d == 1 && n_u > 0 )
eval("tx_dece=mat_ud_"+n_u);
if ( n_d == 1 && n_u == 0 )
eval("tx_dece=mat_de_"+1);
if ( n_d == 2 ) {
eval("tx_dece=mat_de_"+n_d);
if ( n_u > 0 )
tx_dece=tx_dece+"I";
}
if ( n_d > 2 ) {
eval("tx_dece=mat_de_"+n_d);
if ( n_u > 0 )
tx_dece=tx_dece+" Y ";
}
}
if ( n_d == 2 && n_u == 0 ) { tx_dece=tx_dece+"E" }
if ( s_nro.length == 1 && n_d == 0 )
eval("tx_und=mat_un_"+n_u);
if ( parseInt(s_nro) != 1 ) {
if ( p_cents%2 != 0 && p_cents != 1 && n_d != 1 && n_u == 1 ) { tx_dece=tx_dece+"UN" }
if ( p_cents%2 == 0 && p_cents != 1 && n_d != 1 ) { eval("tx_und=mat_un_"+n_u) }
// if ( p_cents == 1 ) { eval("tx_und=mat_un_"+n_u) }
if ( s_nro.length > 1 && n_d != 1 )
eval("tx_und=mat_un_"+n_u)
} else {
if ( p_cents == 1 ) { eval("tx_und=mat_un_"+n_u) }
// if ( p_cents > 1 && nd != 1 ) { tx_und=let_un }
}
// nro_let=num_let+tx_cent+" "+tx_dece+tx_und+txletmil;
//lin=" Ce: "+n_c+" De: "+n_d+" Un: "+n_u+" Nro: "+cad_nro
//debug(lin)
//debug(nro_let)
}
function parseMil(cen,s_nro) {
tx_mll="";
txletmll=""
if ( cen < 2 ) {
return "";
}
if ( cen%2 == 0 ) {
if ( s_nro != "000" ) {
return ""; // let_mil;
}
}
// Los millones y más ... too much !!!
if ( cen == 3 )
tx_mll=mat_mll_1;
if ( cen == 5 )
tx_mll=mat_mll_2;
if ( cen == 7 )
tx_mll=mat_mll_3;
if ( cen == 9 )
tx_mll=mat_mll_4;
if ( cen == 11 )
tx_mll=mat_mll_5;
if ( cen == 13 )
tx_mll=mat_mll_6;
if ( cen == 15 )
tx_mll=mat_mll_7;
if ( cen == 17 )
tx_mll=mat_mll_8;
if ( cen == 19 )
tx_mll=mat_mll_9;
var lonNro=s_nro.length;
if ( parseInt(s_nro) == 1 ) {
txletmll=tx_mll+let_mill;
// return ""; // let_un; // +" "+tx_mll+let_mill;
} else {
txletmll=tx_mll+let_mills;
// return ""; //tx_mll+let_mills;
}
return "";
}
function preparamat(cod_len,cod_gen) {
if ( cod_gen == "f" )
let_fin="as"
else if ( cod_gen == "m" )
let_fin="os"
else if (cod_gen != "f" || cod_gen != "m") {
alert (" Genero : "+cod_gen+" de la lengua : "+cod_len+" Desconocido");
return false;
}
if ( cod_len == "spa" ) {
mat_un_0="";
if (cod_gen=="m")
mat_un_1="UNO";
else
mat_un_1="UNA";
mat_un_2="DOS";
mat_un_3="TRES";
mat_un_4="CUATRO";
mat_un_5="CINCO";
mat_un_6="SEIS";
mat_un_7="SIETE";
mat_un_8="OCHO";
mat_un_9="NUEVE";
mat_ud_0="";
mat_ud_1="ONCE";
mat_ud_2="DOCE";
mat_ud_3="TRECE";
mat_ud_4="CATORCE";
mat_ud_5="QUINCE";
mat_ud_6="DIECISEIS";
mat_ud_7="DIECISIETE";
mat_ud_8="DIECIOCHO";
mat_ud_9="DIECINUEVE";
mat_de_1="DIEZ";
mat_de_2="VEINT";
mat_de_3="TREINTA";
mat_de_4="CUARENTA";
mat_de_5="CINCUENTA";
mat_de_6="SESENTA";
mat_de_7="SETENTA";
mat_de_8="OCHENTA";
mat_de_9="NOVENTA";
if (cod_gen=="m")
let_ciens="CENTOS";
else
let_ciens="CIENTAS";
let_plus100="TO";
mat_ce_1="CIEN";
mat_ce_2="DOS";
mat_ce_3="TRES";
mat_ce_4="CUATRO";
if (cod_gen=="m")
mat_ce_5="QUINIENTOS";
else
mat_ce_5="QUINIENTAS";
mat_ce_6="SEIS";
mat_ce_7="SETE";
mat_ce_8="OCHO";
mat_ce_9="NOVE";
let_un="UN";
let_cien="CIEN";
let_cient="CIENTO";
let_mil ="MIL";
let_mills="LLONES";
let_mill="LLON";
let_con="CON";
car_dec=",";
mat_mll_1="MI";
mat_mll_2="BI";
mat_mll_3="TRI";
mat_mll_4="CUATRI";
mat_mll_5="QUINTI";
mat_mll_6="SESTI";
mat_mll_7="SEPTI";
mat_mll_8="OCTI";
mat_mll_9="NOVI";
for ( var i=1; i < LongLine; i++ )
linPad=linPad+CarPad;
} else {
alert(" Código de Lengua "+cod_len+" No definido !!");
return false;
}
return true
}

784
o_albaran.html Normal file
View File

@ -0,0 +1,784 @@
<TITLE>Albarán Interno</TITLE>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>albaranes</TITLE>
<META NAME="GENERATOR" CONTENT="AdmiSys Sistemas informáticos">
<META NAME="Author" CONTENT="WebTeam">
<META NAME="Organization" CONTENT="AdmiSys S.L.">
<META NAME="Document description" CONTENT="Alta y Modificación de Albaranes Internos">
<META NAME="Last modified date" CONTENT="Thursday, February 06, 1997 07:33:31">
</HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT SRC="albaran.js">
</SCRIPT>
<SERVER>
// Variables para el Server
var HOY=new Date();
var entorno = new entObj(0);
// Algunos formatos para fechas.
var NLDF=""; // para columnas en las queries INFORMIX
var IFDF=""; // para columnas en SQL según DBDATE
// Algunos formatos para nros.
var NF2=""
var NF3=""
var NF4=""
var NF5=""
var NF6=""
var NF7=""
var NF8=""
var NF9=""
var NF10=""
var NF11=""
var NF12=""
var baseHtml="";
dbAcl();
//if ((!request.waux && request.lock) || request.nvo )
LoadParametros();
writeln("<SCRIPT LANGUAGE='JavaScript'>");
//if ((!request.waux && request.lock) || request.nvo )
SetParametros();
writeln('function MasLineas(obj) {');
writeln(' if (obj.name == "AlineasMas" ) { ');
writeln(' nro=parseInt(document.f_albaran.nrolineas.value);');
writeln(' document.f_albaran.nrolineas.value=nro+1;');
writeln(' } ');
writeln(' if (obj.name == "ActasMas" ) { ');
writeln(' nro=parseInt(document.f_albaran.nroctas.value);');
writeln(' document.f_albaran.nroctas.value=nro+1;');
writeln(' } ');
writeln(' FormPaint(obj);');
writeln('} ');
writeln('function FormPaint(obj) {');
writeln(' document.f_albaran.action=window.document.location.href+"&cookie=1&lock=true"');
writeln(' document.f_albaran.submit();'); writeln(' } ');
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln('function RunFunction(obj,valor,clave,f_nro) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.f_albaran;');
writeln(' if ( obj == "Ayuda" ) {');
writeln(' NetHelp(valor);');
writeln(' }');
writeln(' history.back();');
writeln('}');
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
ObjButtons(request.ab_nro_reg,"Albaranes","ab_");
}
writeln('}');
}
if ( request.ViewFkey == "S" ) {
writeln('function RePaint(obj) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' for ( var i=0; i < document.f_albaran.length; i++ ) { ');
writeln(' if ( document.f_albaran.elements[i].name == obj.name ) ');
writeln(' break; ');
writeln(' } ');
writeln(' document.f_albaran.action=mainFrame.document.location.href+"&cookie=1&nro="+nl+"&lock=true"');
writeln(' document.f_albaran.submit();');
writeln('} ');
}
else {
writeln('function ScrollVer(obj) {');
writeln(' status_scroll=true; ');
writeln(' MESSAGE=" ¡¡¡ El Albarán ha cambiado usar el botón de \'Ver\' para "+ ');
writeln(' " actualizar los datos del la Base de Datos desde el Servidor !!! " ');
writeln(' scroll = new statusMessageObject(); ');
writeln(' scroller(); ');
writeln('} ');
writeln('function RePaint(obj) {');
writeln(' if (status_scroll != true ) ');
writeln(' ScrollVer(obj); ');
writeln('} ');
}
writeln('function Enfoca(obj) {')
writeln(' if (obj.name == "linCta" )');
if (request.nvo)
writeln(' document.f_albaran.ac_'+request.nroctas+'_cod_cta.focus();');
else
writeln(' document.f_albaran.ac_1_cod_cta.focus();');
writeln(' if (obj.name == "linAlb" )');
if (request.nvo)
writeln(' document.f_albaran.al_'+request.nrolineas+'_referencia.focus();');
else
writeln(' document.f_albaran.al_1_referencia.focus();');
if ( request.nro ) {
writeln(' document.f_albaran.elements['+request.nro+'].focus();');
}
writeln('}');
writeln(' function Chek_fields(obj) {');
if (request.waux || !request.lock)
writeln(' return true;');
else {
writeln(' if ( emptyField(obj.ab_nro_reg) == true ) { ');
writeln(' alert("!!! Es necesario rellenar el Código de albaran !!!->"+obj.ab_nro_reg.value+"<-");');
writeln(' return false;');
writeln(' } ');
writeln(' if ( emptyField(obj.ab_fecha_emision) == true ) { ');
writeln(' alert("!!! Es necesario rellenar la Fecha de Emisión del Albarán !!!->"+obj.ab_fecha_emision.value+"<-");');
writeln(' return false;');
writeln(' }');
writeln(' if ( emptyField(obj.ab_nif) == true ) { ');
writeln(' alert("!!! Es necesario rellenar el NIF del albarán !!!->"+obj.ab_nif.value+"<-");');
writeln(' return false;');
writeln(' }');
}
writeln(' }');
writeln(' function SumaCtas(obj) {');
writeln(' var SumaDebe=0;');
writeln(' var SumaHaber=0;');
writeln(' var nro=0;');
writeln(' var importe=0;');
writeln(' var Limite=0;');
writeln(' tipoApte="";');
writeln(' Limite=parseInt(document.f_albaran.nroctas.value);');
writeln(' for (var nl=1; nl <= Limite ; nl++) { ');
writeln(' eval("importe=NroUnformat(document.f_albaran.ac_"+nl+"_importe.value)");');
writeln(' nro=parseFloat(importe);');
//writeln(' alert(nro+" "+importe) ');
writeln(' eval("tipoApte=get_value(\'select\',document.f_albaran.ac_"+nl+"_tipo_apte);")');
writeln(' if (tipoApte == "D" ) ');
writeln(' SumaDebe=parseFloat(SumaDebe)+parseFloat(nro);');
writeln(' if (tipoApte == "H" ) ');
writeln(' SumaHaber=parseFloat(SumaHaber)+parseFloat(nro);');
writeln(' }');
//writeln(' alert(" Debe:"+SumaDebe+" Haber:"+SumaHaber)');
writeln(' document.f_albaran.ac_totaldebe.value=NroFormat(SumaDebe+" ",NF11);');
writeln(' document.f_albaran.ac_totalhaber.value=NroFormat(SumaHaber+" ",NF11);');
writeln(' }');
writeln(' function SumaLineas(obj) {');
writeln(' var SumaLineas=0;');
writeln(' var Limite=0;');
writeln(' var cantidad=0;');
writeln(' var precio=0;');
writeln(' var nro=0;');
writeln(' Limite=parseInt(document.f_albaran.nrolineas.value);');
writeln(' for (var nl=1; nl <= Limite ; nl++) { ');
writeln(' eval("cantidad=NroUnformat(document.f_albaran.al_"+nl+"_cantidad.value)");');
writeln(' eval("precio=NroUnformat(document.f_albaran.al_"+nl+"_precio_und.value)");');
writeln(' nro=parseFloat(cantidad)*parseFloat(precio); ');
writeln(' eval("document.f_albaran.al_"+nl+"_total.value=NroFormat(nro+\' \',NF9);");');
writeln(' SumaLineas=parseFloat(SumaLineas)+parseFloat(nro); ');
writeln(' }');
writeln(' document.f_albaran.al_total.value=NroFormat(SumaLineas+" ",NF9);');
writeln(' }');
writeln(' function CalculaLinea(nl) {');
//writeln(' eval("alert(document.f_albaran.al_1_precio_und.value)") ');
writeln(' var nro=0;');
writeln(' eval("nro=Math.round(parseFloat(NroUnformat(document.f_albaran.al_"+nl+"_cantidad.value))*parseFloat(NroUnformat(document.f_albaran.al_"+nl+"_precio_und.value)))");');
writeln(' eval("document.f_albaran.al_"+nl+"_total.value=NroFormat(nro+\' \',NF11);")');
writeln(' SumaLineas(document.f_albaran); ');
writeln(' }');
writeln(' function GoNextField(obj) {');
writeln(' var pos=0; ');
writeln(' pos=pos_form(document.f_albaran,obj.name); ');
writeln(' if ( pos+1 >= 0 && pos+1 <= document.f_albaran.elements.length) ');
writeln(' document.f_albaran.elements[pos+1].focus();');
writeln(' }');
writeln(' function ChkLinCta(icta) {');
writeln(' var f=document.f_albaran;');
writeln(' var paso=true; ');
writeln(' var valor="";');
writeln(' var nro=0;');
writeln(' eval("if ( f.ac_"+icta+"_cod_cta.value.length < 2 || f.ac_"+icta+"_cod_cta.value == \'\') { paso=false }")');
writeln(' if ( paso == false ) ');
writeln(' return; ');
writeln(' eval("valor=f.ac_"+icta+"_clave.value;")');
writeln(' eval("if ( valor.length < 2 || valor == \'\' || !valor ) { scanClaveCta("+icta+");}")');
writeln(' eval("nro=parseInt(NroUnformat(f.ac_"+icta+"_importe.value));")');
writeln(' eval("valor=f.ac_"+icta+"_concepto.value;")');
writeln(' if ( valor.length == 0 ) { ');
writeln(' if ( nro < 0 ) { '),
writeln(' eval("f.ac_"+icta+"_concepto.value=\'A\'");');
writeln(' }');
writeln(' if ( nro > 0 ) { ');
writeln(' eval("f.ac_"+icta+"_concepto.value=\' \'"); ');
writeln(' }');
writeln(' };');
writeln(' }');
writeln(' function GoField() {');
writeln(' var f=document.f_albaran; ');
writeln(' var nregy=""; ');
writeln(' var nregn=""; ');
writeln(' if ( f.ab_is_locked.value == "S" ) {');
writeln(' if ( f.ab_fra_reg.value.length > 0 ) {');
writeln(' nregy=f.ab_fra_reg.value.substring(0,4); ');
writeln(' nregn=f.ab_fra_reg.value.substring(4,10); ');
writeln(' alert("\\r El Albarán está bloqueado.\\r Fra. Nro. Reg. "+nregn+"/"+nregy); ');
writeln(' } else ');
writeln(' alert("\\r¡¡¡ El Albarán está bloqueado !!!"); ');
writeln(' } ');
if ( request.prt) {
// writeln('w_auxiliar(\'factura\',\'Reg_'+request.prt+'\',\'fa_nro_reg\',\''+StringClip(true,request.prt)+'\');');
// writeln(' alert("\\rNro. Regisro: '+nregn+'/'+nregy+' creado. ");');
}
if (request.exec=="add" || request.exec == "upd" )
writeln(' f.submit(); ');
writeln(' if ( f.ab_t_razon_social.value == "NO EXISTE" ) {');
writeln(' alert("!!! El NIF del Proveedor no Existe !!!->"+f.ab_nif.value+"<-");');
writeln(' return; ');
writeln(' }' );
writeln(' if (f.ab_cond_pago.value+"" == pa_cp_lock+"" ) {');
writeln(' alert("!!! El Proveedor está Bloqueado !!!->"+f.ab_cond_pago.value+"<-");');
writeln(' }' );
if (request.Alb || request.exec == "lin" )
writeln(' Enfoca("linAlb");');
if (request.Act || request.exec == "cta")
writeln(' Enfoca("linCta");');
if (!request.Act && !request.Alb)
writeln(' f.ab_nro_reg.focus();');
writeln(' }');
writeln("</SCRIPT>");
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\',\''+request.nvo+'\','+request.nro+')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons();GoField();SumaCtas(this);SumaLineas(this)"');
else
writeln('<BODY OnLoad="GoField();SumaCtas(this);SumaLineas(this)" ');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
if (request.gofunc) {
writeln(' </BODY>');
writeln(' </HTML>');
writeln(' <!--');
}
if (!request.cookie && !request.gofunc) {
dbConnect();
// Vemos que tarea hay que ejecutar:
if (request.add) {
if ( entriesExist(" from albaranes where nro_reg=\'"+StringClip(true,request.ab_nro_reg)+"\'") == true ){
redirect(addClient('error.html?alert=2'));
}
else {
client.is_trans=true;
database.beginTransaction();
status=database.execute("INSERT INTO albaranes(" +
" nro_reg," +
" is_locked," +
" fra_reg," +
" fecha_emision," +
" nif," +
" cod_centro," +
" por_reten," +
" importe_reten," +
" nro_pedido," +
" vto_jefe_obra," +
" vto_jefe_grupo," +
" vto_proveedor," +
" observaciones) VALUES ('" + StringClip(true,request.ab_nro_reg) + "','" +
request.ab_is_locked + "','"+
request.ab_fra_reg + "','"+
DateFormat(request.ab_fecha_emision,NLDF) + "','"+
StringClip(true,request.ab_nif) + "','"+
StringClip(true,request.ab_cod_centro) + "','"+
NroUnformat(request.ab_por_reten) + "','"+
NroUnformat(request.ab_importe_reten) + "','"+
StringClip(true,request.ab_nro_pedido) + "','"+
StringClip(true,request.ab_vto_jefe_obra) + "','"+
StringClip(true,request.ab_vto_jefe_grupo) + "','"+
StringClip(true,request.ab_vto_proveedor) + "','"+
StringClip(true,request.ab_observaciones) + "')");
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect(addClient('error.html?alert=8'));
}
DbsError(true,status);
InsAlbLins();
database.commitTransaction();
client.is_trans=false;
}
redirect(addClient("o_albaran.html?nvo=1&"+baseHtml));
}
//Ejecuta una actualización de la fila sobre la fila actual ...
if (request.upd && request.ab_nro_reg) {
// if (request.lock)
// client.is_trans=true;
database.beginTransaction();
status=database.execute("UPDATE albaranes SET "+
" is_locked='" + request.ab_is_locked + "',"+
" fra_reg='" + request.ab_fra_reg + "',"+
" fecha_emision='" + DateFormat(request.ab_fecha_emision,NLDF) + "',"+
" nif='" + StringClip(true,request.ab_nif) + "',"+
" cod_centro='" + StringClip(true,request.ab_cod_centro) + "',"+
" por_reten='" + NroUnformat(request.ab_por_reten) + "',"+
" importe_reten='" + NroUnformat(request.ab_importe_reten) + "',"+
" nro_pedido='" + StringClip(true,request.ab_nro_pedido) + "',"+
" vto_jefe_obra='" + StringClip(true,request.ab_vto_jefe_obra) + "',"+
" vto_jefe_grupo='" + StringClip(true,request.ab_vto_jefe_grupo) + "',"+
" vto_proveedor='" + StringClip(true,request.ab_vto_proveedor) + "',"+
" observaciones='" + StringClip(true,request.ab_observaciones) + "'"+
" WHERE nro_reg = '" + request.ab_nro_reg + "'" );
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect(addClient('error.html?alert=9'));
}
DbsError(true,status);
DelAlbLins();
InsAlbLins();
database.commitTransaction();
client.is_trans=false;
redirect(addClient("g_albaran.html?"+baseHtml));
}
//Ejecuta un borrado de la fila actual ...
if (request.del) {
client.is_trans=true;
database.beginTransaction();
status=database.execute("DELETE FROM albaranes WHERE nro_reg = \'" + request.ab_nro_reg + "\'");
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect(addClient('error.html?alert=10'));
}
DbsError(true,status);
DelAlbLins();
database.commitTransaction();
client.is_trans=false;
redirect(addClient("g_albaran.html?"+baseHtml));
}
if (request.ab_nro_reg && !request.upd && !request.add ) {
// Si hay Clave de la tabla seleccionamos los datos ....
//Si se busca la fila ... usando la clave primaria de la relación
if (request.lock) {
client.is_trans=true;
database.beginTransaction();
CursorTabla("ab","nro_reg","=\'"+request.ab_nro_reg+"\'",true,true);
}
else
CursorTabla("ab","nro_reg","=\'"+request.ab_nro_reg+"\'",true,"");
// Asignamos a request todas las columnas necesarias para el form.
request.ab_nro_reg=StringClip(true,c_albaranes.nro_reg);
request.ab_is_locked=c_albaranes.is_locked;
request.ab_fra_reg=StringClip(true,c_albaranes.fra_reg);
request.ab_fecha_emision=datetoString(c_albaranes.fecha_emision);
request.ab_nif=StringClip(true,c_albaranes.nif);
request.ab_cod_centro=StringClip(false,c_albaranes.cod_centro);
request.ab_por_reten=c_albaranes.por_reten;
request.ab_importe_reten=NroFormat(c_albaranes.importe_reten,NF9);
request.ab_nro_pedido=StringClip(true,c_albaranes.nro_pedido);
request.ab_vto_jefe_obra=StringClip(true,c_albaranes.vto_jefe_obra);
request.ab_vto_jefe_grupo=StringClip(true,c_albaranes.vto_jefe_grupo);
request.ab_vto_proveedor=StringClip(true,c_albaranes.vto_proveedor);
request.ab_observaciones=StringClip(true,c_albaranes.observaciones);
request.ab_is_locked=StringClip(true,c_albaranes.is_locked);
if (request.lock)
c_albaranes.close();
if (request.ab_is_locked == "S" )
request.waux=8;
if (request.ab_nif && request.ab_nif != null ) {
CursorTabla("pr","nif","=\'"+StringClip(true,request.ab_nif)+"\'",false,false);
request.ab_t_razon_social=StringClip(false,c_proveedores.razon_social);
if ( request.ab_t_razon_social == " " ) {
request.ab_t_razon_social="NO EXISTE";
request.ab_cta_contable="";
request.ab_cond_pago="";
} else {
request.ab_cta_contable=StringClip(false,c_proveedores.cta_contable);
request.ab_cond_pago=c_proveedores.cond_pago;
}
c_proveedores.close();
}
else {
request.ab_t_razon_social="";
request.ab_cta_contable="";
request.ab_cond_pago="";
}
if (request.ab_cod_centro && request.ab_cod_centro != null) {
CursorTabla("ce","cod_centro","=\'"+StringClip(true,request.ab_cod_centro)+"\'",false,false);
request.ab_t_des_centro=c_centros.descripcion;
c_centros.close();
}
else
request.ab_t_des_centro="";
if (request.ab_nro_pedido && request.ab_nro_pedido != null) {
CursorTabla("pe","nro_pedido","=\'"+StringClip(true,request.ab_nro_pedido)+"\'",false,false);
request.ab_t_des_pedido=c_pedidos.descripcion;
c_pedidos.close();
}
else
request.ab_t_des_pedido="";
if (request.lock)
CursorTabla("al","nro_reg","=\'"+request.ab_nro_reg+"\'",false,true);
else
CursorTabla("al","nro_reg","=\'"+request.ab_nro_reg+"\'",false,"");
var SumaLineas=0;
request.nrolineas=1;
nl=0;
while (c_albalineas.next()) {
request.nrolineas++; nl++;
eval("request.al_"+nl+"_nro_lin=request.c_albalineas.nro_lin");
eval("request.al_"+nl+"_nro_reg=StringClip(true,c_albalineas.nro_reg)");
eval("request.al_"+nl+"_cantidad=NroFormat(c_albalineas.cantidad,NF5)");
eval("request.al_"+nl+"_referencia=StringClip(true,c_albalineas.referencia)");
eval("request.al_"+nl+"_descripcion=StringClip(true,c_albalineas.descripcion)");
eval("request.al_"+nl+"_precio_und=NroFormat(c_albalineas.precio_und,NF8)");
eval("request.al_"+nl+"_total=NroFormat(c_albalineas.cantidad*c_albalineas.precio_und,NF9)");
SumaLineas=SumaLineas+(c_albalineas.cantidad*c_albalineas.precio_und);
}
c_albalineas.close()
request.al_total=NroFormat(SumaLineas,NF9);
if (request.lock)
CursorTabla("ac","nro_reg","=\'"+request.ab_nro_reg+"\'",false,true);
else
CursorTabla("ac","nro_reg","=\'"+request.ab_nro_reg+"\'",false,"");
var SumaDebe=0;
var SumaHaber=0;
request.nroctas=0;
nl=0;
while (c_aptecuentas.next()) {
request.nroctas++; nl++;
eval("request.ac_"+nl+"_nro_lin=c_aptecuentas.nro_lin");
eval("request.ac_"+nl+"_nro_reg=StringClip(true,c_aptecuentas.nro_reg)");
eval("request.ac_"+nl+"_tipolin=StringClip(true,c_aptecuentas.tipolin)");
eval("request.ac_"+nl+"_cod_cta=StringClip(true,c_aptecuentas.cod_cta)");
eval("request.ac_"+nl+"_concepto=StringClip(true,c_aptecuentas.concepto)");
eval("request.ac_"+nl+"_clave=StringClip(true,c_aptecuentas.clave)");
eval("request.ac_"+nl+"_importe=NroFormat(c_aptecuentas.importe,NF9);");
eval("request.ac_"+nl+"_tipo_apte=StringClip(true,c_aptecuentas.tipo_apte)");
eval("request.ac_"+nl+"_fecha=c_aptecuentas.fecha");
if ( c_aptecuentas.tipo_apte == "D" )
SumaDebe=SumaDebe+c_aptecuentas.importe;
if ( c_aptecuentas.tipo_apte == "H" )
SumaHaber=SumaHaber+c_aptecuentas.importe;
}
request.ac_totaldebe=NroFormat(SumaDebe,NF11);
request.ac_totalhaber=NroFormat(SumaHaber,NF11);
if (request.nroctas ==0 )
request.nroctas=1;
c_aptecuentas.close()
}
else {
// Estos son los Defaults Reales del Form ... Aquí pueden cambiarse ...
IniciaRequest("ab_");
request.lock=true;
request.nroctas=2;
request.nrolineas=1;
request.ac_totalhaber=0;
request.ac_totaldebe=0;
request.al_total=0;
request.ab_t_razon_social="";
request.ab_cta_contable="";
request.ab_t_des_pedido="";
request.ab_t_des_centro="";
request.ab_cond_pago="";
}
}
else if (!request.gofunc) {
// Se entiende que request contiene todas las columnas necesarias para el form.
// y que esta llamada es para leer y cargar las claves foráneas de la tabla.
if (request.nvo && request.ab_nro_reg && request.ab_nro_reg != null ) {
if ( entriesExist(" from albaranes where nro_reg=\'"+StringClip(true,request.ab_nro_reg)+"\'") == true ) {
redirect("alertpage.html?alert=2");
}
}
if (request.ab_nif && request.ab_nif != null ) {
CursorTabla("pr","nif","=\'"+StringClip(true,request.ab_nif)+"\'",false,false);
request.ab_t_razon_social=StringClip(false,c_proveedores.razon_social);
if ( request.ab_t_razon_social == " " ) {
request.ab_t_razon_social="NO EXISTE";
request.ab_cta_contable="";
request.ab_cond_pago="";
} else {
request.ab_cta_contable=StringClip(false,c_proveedores.cta_contable);
request.ab_cond_pago=c_proveedores.cond_pago;
}
c_proveedores.close();
}
else {
request.ab_t_razon_social="";
request.ab_cta_contable="";
request.ab_cond_pago="";
}
if (request.ab_cod_centro && request.ab_cod_centro != null) {
CursorTabla("ce","cod_centro","=\'"+StringClip(true,request.ab_cod_centro)+"\'",false,false);
request.ab_t_des_centro=c_centros.descripcion;
c_centros.close();
}
else
request.ab_t_des_centro="";
if (request.ab_nro_pedido && request.ab_nro_pedido != null) {
CursorTabla("pe","nro_pedido","=\'"+StringClip(true,request.ab_nro_pedido)+"\'",false,false);
request.ab_t_des_pedido=c_pedidos.descripcion;
c_pedidos.close();
}
else
request.ab_t_des_pedido="";
}
writeln('<FORM NAME="f_albaran" METHOD="post"');
if (request.ab_nro_reg && !request.nvo)
htmlpath="o_albaran.html?ab_nro_reg="+escape(request.ab_nro_reg)+"&"+baseHtml;
else
htmlpath="o_albaran.html?nvo=1"+baseHtml;
writeln('action="'+htmlpath+'"');
writeln(' onSubmit="return Chek_fields(this)">');
LoadHidden(htmlpath);
if (!request.waux && request.FrameType == "L" )
ObjHeadBar(request.ab_nro_reg,"Albarán","ab_");
write('<CENTER><TABLE BORDER=1 ALIGN=CENTER><TR>');
//if (!request.waux)
// writeln('<TD ALIGN=RIGHT><INPUT TYPE="button" VALUE=" Código " ONCLICK="w_auxiliar(\'nro_reg\',\'nro_reg\',\'ab_nro_reg\',\''+request.ab_nro_reg+'\')">');
//else {
//if (request.waux == 2)
// writeln('<TD></TD><TD align="right" valign="top"><A HREF="javascript:top.close()"><IMG SRC="images/exit1.gif" BORDER=0 HEIGHT=37 WIDTH=44></A></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B> Nro.Reg.: </B>');
//}
if (request.ab_nro_reg && !request.nvo)
writeln('<FONT COLOR="#800040"><B>'+request.ab_nro_reg+'</B></FONT><INPUT type="hidden" name="ab_nro_reg" VALUE="'+request.ab_nro_reg+'"></TD></FONT>');
else
writeln('<INPUT TYPE="text" NAME="ab_nro_reg" VALUE="'+request.ab_nro_reg+'" SIZE=10 OnChange="//RePaint(this)"></TD>');
if (request.waux || !request.lock) {
if ( request.ab_fra_reg.length > 2 )
writeln('<FONT COLOR="#800040">Nro.Reg.Fra.:<B>'+request.ab_fra_reg+'</FONT>');
if ( request.ab_is_locked == "S" )
writeln('<FONT COLOR="#800040">Bloqueado<B></FONT></TR>');
}
writeln('<INPUT type="hidden" name="ab_is_locked" VALUE="'+request.ab_is_locked+'">');
writeln('<INPUT type="hidden" name="ab_fra_reg" VALUE="'+request.ab_fra_reg+'"></TD>');
writeln('<TD ALIGN=RIGHT><B>Fecha Emisión:</B>');
if (request.waux || !request.lock)
writeln('<FONT COLOR="#800040"><B>'+request.ab_fecha_emision+'</FONT><INPUT type="hidden" name="ab_fecha_emision" VALUE="'+request.ab_fecha_emision+'" size=8 maxlength=8></TD></FONT></TR>');
else
writeln('<INPUT type="text" name="ab_fecha_emision" VALUE="'+request.ab_fecha_emision+'" onBlur="ToStringDate(this,IFDF)" onFocus="UnfrmtStrDate(this,IFDF)" size=8 maxlength=8></TD></TR>');
if (!request.waux || !request.lock)
writeln('<TR><TD ALIGN=RIGHT><INPUT TYPE="button" VALUE=" N.I.F. " ONCLICK="w_auxiliar(\'proveedor\',\'Proveedores\',\'pr_nif\',\''+StringClip(true,request.ab_nif)+'\')">');
else
writeln('<TR><TD ALIGN=RIGHT><B> N.I.F. </B>');
if (request.waux || !request.lock)
writeln('<FONT COLOR="#800040"><B>'+request.ab_nif+'</B></FONT><INPUT type="hidden" name="ab_nif" VALUE="'+request.ab_nif+'"></TD>');
else
writeln('<INPUT TYPE="text" NAME="ab_nif" VALUE="'+request.ab_nif+'" SIZE=12 OnChange="this.value=this.value.toUpperCase();RePaint(this)" ></TD>');
if (request.ab_t_razon_social == "NO EXISTE")
writeln('<TD ALIGN=LEFT><BLINK><FONT COLOR="#800040">'+request.ab_t_razon_social+'</FONT></BLINK></TD></TR>');
else
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.ab_t_razon_social+'</FONT></TD></TR>');
writeln('<INPUT type="hidden" name="ab_t_razon_social" VALUE="'+request.ab_t_razon_social+'">');
writeln('<INPUT type="hidden" name="ab_cta_contable" VALUE="'+request.ab_cta_contable+'">');
writeln('<INPUT type="hidden" name="ab_cond_pago" VALUE="'+request.ab_cond_pago+'">');
if (!request.waux || !request.lock)
writeln('<TR><TD ALIGN=RIGHT><INPUT TYPE="button" VALUE="Centro" ONCLICK="w_auxiliar(\'centro\',\'Centros\',\'ce_cod_centro\',\''+StringClip(true,request.ab_cod_centro)+'\')">');
else
writeln('<TR><TD ALIGN=RIGHT><B>Centro</B>');
if (request.waux || !request.lock)
writeln('<FONT COLOR="#800040"><B>'+request.ab_cod_centro+'</B></FONT><INPUT TYPE="hidden" NAME="ab_con_centro" VALUE="'+request.ab_cod_centro+'" SIZE=12 OnChange="RePaint(this)"> </TD>');
else
writeln('<INPUT TYPE="text" NAME="ab_cod_centro" VALUE="'+request.ab_cod_centro+'" SIZE=12 OnChange="RePaint(this)"> </TD>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.ab_t_des_centro+'</FONT></TD>');
if (!request.waux || !request.lock)
writeln('<TR><TD ALIGN=RIGHT><INPUT TYPE="button" VALUE="Pedido" ONCLICK="w_auxiliar(\'pedido\',\'Pedidos\',\'pe_nro_pedido\',\''+StringClip(true,request.ab_nro_pedido)+'\')">');
else
writeln('<TR><TD ALIGN=RIGHT><B>Pedido</B>');
if (request.waux || !request.lock)
writeln('<FONT COLOR="#800040"><B>'+request.ab_nro_pedido+'</B></FONT><INPUT TYPE="hidden" NAME="ab_nro_pedio" VALUE="'+request.ab_nro_pedido+'" SIZE=12 maxlength=20 OnChange="RePaint(this)"> </TD>');
else
writeln('<INPUT TYPE="text" NAME="ab_nro_pedido" VALUE="'+request.ab_nro_pedido+'" SIZE=12 MAXLENGTH=20 OnChange="RePaint(this)"> </TD>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.ab_t_des_pedido+'</FONT></TD>');
writeln('<TR><TD ALIGN=RIGHT><B>Retenciones:</B>');
if (request.waux || !request.lock)
writeln('<FONT COLOR="#800040"><B>'+request.ab_por_reten+'</FONT><INPUT type="hidden" name="ab_por_reten" VALUE="'+request.ab_por_reten+'" size=2 maxlength=2></TD></FONT></TD>');
else
writeln('<INPUT type="text" name="ab_por_reten" VALUE="'+request.ab_por_reten+'" onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" size=2 maxlength=2></TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.ab_importe_reten+'</FONT><INPUT type="hidden" name="ab_importe_reten" VALUE="'+request.ab_importe_reten+'" size=10 maxlength=10></TD></FONT></TR>');
else
writeln('<TD><INPUT type="text" name="ab_importe_reten" VALUE="'+request.ab_importe_reten+'" onBlur="NroToString(this,NF9)" onFocus="StringToNro(this,NF9)" size=11 maxlength=11></TD></TR>');
writeln('</TABLE>');
writeln('<A NAME="lin-ctas"><CENTER><H2><FONT COLOR="#800040"> Cuentas de Gastos </FONT></H2></CENTER><A>');
writeln('<INPUT TYPE="hidden" NAME="nroctas" VALUE="'+request.nroctas+'" SIZE=2 >');
writeln('<TABLE BORDER=1 ALIGN=CENTER>');
writeln('<TR><TD ALIGN=CENTER><B>N.</B> </TD>');
writeln('<TD><INPUT TYPE="button" VALUE="Cuenta Cont." ');
writeln(' ONCLICK="w_auxiliar(\'ctascont\',\'Cuentas_Contables\',\'ct_cta_contable\',\'\')"></TD>');
writeln('<TD ALIGN=CENTER><B>T&iacute;tulo Cuenta</B></TD>');
writeln('<TD ALIGN=CENTER><B>Importe</B> </TD>');
writeln('<TD ALIGN=CENTER><B>Tipo Ap.</B> </TD>');
writeln('<TD><B>Clave</B></TD>');
writeln('<TD ALIGN=CENTER><B>Concepto</B> </TD>');
for (var nl=1; nl <= request.nroctas ; nl++) {
eval('if (!request.ac_'+nl+'_nro_lin) { request.ac_'+nl+'_nro_lin='+nl+'}');
eval('if (!request.ac_'+nl+'_tipolin) { request.ac_'+nl+'_tipolin="G"};');
eval('if (!request.ac_'+nl+'_cod_cta) { request.ac_'+nl+'_cod_cta=""; request.ac_'+nl+'_t_cta_contable=""};');
eval('if (!request.ac_'+nl+'_clave){ request.ac_'+nl+'_clave=""};');
eval('if (!request.ac_'+nl+'_concepto){ request.ac_'+nl+'_concepto=""};');
eval('if (!request.ac_'+nl+'_tipo_apte){ request.ac_'+nl+'_tipo_apte=""};');
eval('if (!request.ac_'+nl+'_importe) { request.ac_'+nl+'_importe=0};');
eval('writeln(\'<TR><TD><FONT COLOR="#800040"><B>\'+request.ac_'+nl+'_nro_lin+\'</B></FONT><INPUT TYPE="hidden" NAME="ac_'+nl+'_nro_lin" VALUE="\'+request.ac_'+nl+'_nro_lin+\'" SIZE=2 ></TD> \');');
eval('writeln(\'<INPUT TYPE="hidden" NAME="ac_'+nl+'_tipolin" VALUE="\'+request.ac_'+nl+'_tipolin+\'" SIZE=1 ></TD>\');');
if (request.waux || !request.lock)
eval('writeln(\'<TD ALIGN=CENTER>\'+request.ac_'+nl+'_cod_cta+\'<FONT COLOR="#800040"><B><INPUT TYPE="hidden" NAME="ac_'+nl+'_cod_cta" VALUE="\'+request.ac_'+nl+'_cod_cta+\'" SIZE=12 ></TD>\');');
else
eval('writeln(\'<TD ALIGN=CENTER><INPUT TYPE="text" NAME="ac_'+nl+'_cod_cta" VALUE="\'+request.ac_'+nl+'_cod_cta+\'" OnChange="CtaNroPad(this);RePaint(this)" SIZE='+client.pa_longcta+' ></TD>\');');
eval('valor=request.ac_'+nl+'_cod_cta;');
if (valor != " " && valor != "" && valor != "null" ) {
CursorTabla("ct","cta_contable","=\'"+StringClip(true,valor)+"\'",false,false);
texto=c_ctas_contables.descripcion;
c_ctas_contables.close();
}
else {
texto=" "
}
eval('request.ac_'+nl+'_t_cta_contable=texto;');
eval('writeln(\'<TD><FONT COLOR="#800040">\'+request.ac_'+nl+'_t_cta_contable+\'</FONT></TD>\');');
if (request.waux || !request.lock)
eval('writeln(\'<TD><FONT COLOR="#800040"><B>\'+request.ac_'+nl+'_importe+\'</B></FONT><INPUT TYPE="hidden" NAME="ac_'+nl+'_importe" VALUE="\'+request.ac_'+nl+'_importe+\'" SIZE=11 ></TD>\');');
else
eval('writeln(\'<TD><INPUT TYPE="text" NAME="ac_'+nl+'_importe" VALUE="\'+request.ac_'+nl+'_importe+\'" OnChange="ChkLinCta('+nl+');SumaCtas(this)" onBlur="NroToString(this,NF9)" onFocus="StringToNro(this,NF9)" SIZE=11 ></TD>\');');
if (request.waux || !request.lock)
eval('writeln(\'<TD><FONT COLOR="#800040"><B>\'+request.ac_'+nl+'_tipo_apte+\'</B></FONT><INPUT TYPE="hidden" NAME="ac_'+nl+'_tipo_apte" VALUE="\'+request.ac_'+nl+'_tipo_apte+\'" SIZE=1 ></TD>\');'); else
eval('if (request.ac_'+nl+'_tipo_apte == "H") {writeln(\'<TD><SELECT NAME="ac_'+nl+'_tipo_apte" OnChange="ChkLinCta('+nl+');SumaCtas(this)" SIZE=1><OPTION VALUE="H" SELECTED>Haber<OPTION VALUE="D">Debe</SELECT></TD>\');}else{writeln(\'<TD><SELECT NAME="ac_'+nl+'_tipo_apte" SIZE=1><OPTION VALUE="D" SELECTED>Debe<OPTION VALUE="H">Haber</SELECT></TD>\');}');
if (request.waux || !request.lock)
eval('writeln(\'<TD ALIGN=CENTER>\'+request.ac_'+nl+'_clave+\'<FONT COLOR="#800040"><B><INPUT TYPE="hidden" NAME="ac_'+nl+'_clave" VALUE="\'+request.ac_'+nl+'_clave+\'" OnFocus="ChkLinCta('+nl+');//RePaint(this)" SIZE=3 ></TD>\');');
else
eval('writeln(\'<TD ALIGN=CENTER><INPUT TYPE="text" NAME="ac_'+nl+'_clave" VALUE="\'+request.ac_'+nl+'_clave+\'" OnChange="//RePaint(this)" SIZE=3 ></TD>\');');
if (request.waux || !request.lock)
eval('writeln(\'<TD ALIGN=CENTER>\'+request.ac_'+nl+'_concepto+\'<FONT COLOR="#800040"><B><INPUT TYPE="hidden" NAME="ac_'+nl+'_concepto" VALUE="\'+request.ac_'+nl+'_concepto+\'" SIZE=12 maxlength=35 ></TD>\');');
else
eval('writeln(\'<TD ALIGN=CENTER><INPUT TYPE="text" NAME="ac_'+nl+'_concepto" VALUE="\'+request.ac_'+nl+'_concepto+\'" OnChange="//RePaint(this)" SIZE=12 maxlength=35 ></TD>\');');
writeln("</TR>");
}
writeln('</TABLE>');
if (!request.waux && request.lock) {
writeln('<TABLE ALIGN="CENTER" BORDER="0" CELLSPACING="2" CELLPADDING="0" WIDTH="100%"><TR>');
writeln('<TD ALIGN=LEFT><INPUT type="button" name="Ver" value="Ver" onClick="FormPaint(this)"></TD>');
writeln('<TD ALIGN=RIGHT><INPUT type="button" name="ActasMas" value="Más Líneas" onClick="MasLineas(this)"></TD>');
writeln('</TR></TABLE>');
}
writeln('<TABLE BORDER=1 ALIGN=CENTER><TR>');
writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>Total Debe</B></FONT></TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.ac_totaldebe+'<INPUT TYPE="hidden" NAME="ac_totaldebe" VALUE="'+request.ac_totaldebe+'" SIZE=14 ></FONT></TD>');
else
writeln('<TD><FONT COLOR="#800040"><B><INPUT TYPE="text" NAME="ac_totaldebe" VALUE="'+request.ac_totaldebe+'" OnFocus="SumaCtas(this);//GoNextField(this)" onBlur="NroToString(this,NF11)" onFocus="StringToNro(this,NF11)" SIZE=14 ></FONT></TD>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>Total Haber</B></FONT></TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.ac_totalhaber+'<INPUT TYPE="hidden" NAME="ac_totalhaber" VALUE="'+request.ac_totalhaber+'" SIZE=14 ></FONT></TD>');
else
writeln('<TD><FONT COLOR="#800040"><B><INPUT TYPE="text" NAME="ac_totalhaber" VALUE="'+request.ac_totalhaber+'" OnFocus="SumaCtas(this);//GoNextField(this)" onBlur="NroToString(this,NF11)" onFocus="StringToNro(this,NF11)" SIZE=14 ></FONT></TD>');
writeln('</TR></TABLE>');
writeln('<A NAME="lin-albaran"><CENTER><H2><FONT COLOR="#800040"> Líneas del Albarán </FONT></H2></CENTER></A>');
writeln('<INPUT TYPE="hidden" NAME="nrolineas" VALUE="'+request.nrolineas+'" SIZE=2 >');
writeln('<TABLE BORDER=1 ALIGN=CENTER>');
writeln('<TR><TD><B>Nro.</B> </TD>');
writeln('<TD><B>Referencia</B></TD>');
writeln('<TD><B>Cant.</B> </TD>');
writeln('<TD><B>D e s c r i p c i &oacute; n</B> </TD>');
writeln('<TD><B>P. Unidad</B></TD>');
writeln('<TD><B>T O T A L</B> </TD></TR>');
for (var nl=1; nl <= request.nrolineas; nl++) {
eval('if (!request.al_'+nl+'_nro_lin) { request.al_'+nl+'_nro_lin='+nl+'};');
eval('if (!request.al_'+nl+'_referencia) { request.al_'+nl+'_referencia=" "};');
eval('if (!request.al_'+nl+'_cantidad) { request.al_'+nl+'_cantidad=0};');
eval('if (!request.al_'+nl+'_descripcion) { request.al_'+nl+'_descripcion=" "};');
eval('if (!request.al_'+nl+'_precio_und) { request.al_'+nl+'_precio_und=0};');
eval('if (!request.al_'+nl+'_total) { request.al_'+nl+'_total=0};');
eval('writeln(\'<TR><TD><FONT COLOR="#800040"><B>\'+request.al_'+nl+'_nro_lin+\'</B></FONT><INPUT TYPE="hidden" NAME="al_'+nl+'_nro_lin" VALUE="\'+request.al_'+nl+'_nro_lin+\'" SIZE=2 ></TD> \');');
// eval('writeln(\' OnFocus="AlValor('+nl+')"></TD>\');');
if (request.waux || !request.lock)
eval('writeln(\'<TD><FONT COLOR="#800040"><B>\'+request.al_'+nl+'_referencia+\'</B></FONT><INPUT TYPE="hidden" NAME="al_'+nl+'_referencia" VALUE="\'+request.al_'+nl+'_referencia+\'" SIZE=8 maxlength=12 ></TD>\')');
else
eval('writeln(\'<TD><INPUT TYPE="text" NAME="al_'+nl+'_referencia" VALUE="\'+request.al_'+nl+'_referencia+\'" SIZE=8 maxlength=12 ></TD>\')');
if (request.waux || !request.lock)
eval('writeln(\'<TD><FONT COLOR="#800040"><B>\'+request.al_'+nl+'_cantidad+\'</B></FONT><INPUT TYPE="hidden" NAME="al_'+nl+'_cantidad" VALUE="\'+request.al_'+nl+'_cantidad+\'" SIZE=6 ></TD>\')');
else
eval('writeln(\'<TD><INPUT TYPE="text" NAME="al_'+nl+'_cantidad" VALUE="\'+request.al_'+nl+'_cantidad+\'" OnChange="CalculaLinea('+nl+')" onBlur="NroToString(this,NF5)" onFocus="StringToNro(this,NF5)" SIZE=6 ></TD>\')');
if (request.waux || !request.lock)
eval('writeln(\'<TD><FONT COLOR="#800040"><B>\'+request.al_'+nl+'_descripcion+\'</B></FONT><INPUT TYPE="hidden" NAME="al_'+nl+'_descripcion" VALUE="\'+request.al_'+nl+'_descripcion+\'" SIZE=25 maxlength=40></TD>\');');
else
eval('writeln(\'<TD><INPUT TYPE="text" NAME="al_'+nl+'_descripcion" VALUE="\'+request.al_'+nl+'_descripcion+\'" SIZE=25 maxlength=40></TD>\');');
if (request.waux || !request.lock)
eval('writeln(\'<TD><FONT COLOR="#800040"><B>\'+request.al_'+nl+'_precio_und+\'</B></FONT><INPUT TYPE="hidden" NAME="al_'+nl+'_precio_und" VALUE="\'+request.al_'+nl+'_precio_und+\'" SIZE=10 ></TD>\');');
else
eval('writeln(\'<TD><INPUT TYPE="text" NAME="al_'+nl+'_precio_und" VALUE="\'+request.al_'+nl+'_precio_und+\'" OnChange="CalculaLinea('+nl+')" onBlur="NroToString(this,NF8)" onFocus="StringToNro(this,NF8)" SIZE=10 ></TD>\');');
eval('request.al_'+nl+'_total=request.al_'+nl+'_cantidad*request.al_'+nl+'_precio_und;');
if (request.waux || !request.lock)
eval('writeln(\'<TD><FONT COLOR="#800040"><B>\'+request.al_'+nl+'_total+\'</B></FONT><INPUT TYPE="hidden" NAME="al_'+nl+'_total" VALUE="\'+request.al_'+nl+'_total+ \'" SIZE=15 ></TD></TR>\');');
else
eval('writeln(\'<TD><INPUT TYPE="text" NAME="al_'+nl+'_total" VALUE="\'+request.al_'+nl+'_total+ \'" OnFocus="CalculaLinea('+nl+');//GoNextField(this)" onBlur="NroToString(this,NF9)" onFocus="StringToNro(this,NF9)" SIZE=11 ></TD></TR>\');');
}
writeln('<TR><TD></TD>');
writeln('<TD></TD><TD></TD>');
writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>S u m a T o t a l ...... </B></FONT></TD>');
writeln('<TD></TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.al_total+'<INPUT TYPE="hidden" NAME="al_total" VALUE="'+request.ac_total+'" SIZE=11 ></FONT></TD>');
else
writeln('<TD><INPUT TYPE="text" NAME="al_total" VALUE="'+request.al_total+'" OnFocus="SumaLineas(this);//GoNextField(this)" onBlur="NroToString(this,NF11)" onFocus="StringToNro(this,NF9)" SIZE=11 ></TD>');
writeln('<TR></TABLE>');
if (!request.waux && request.lock) {
writeln('<TABLE ALIGN="CENTER" BORDER="0" CELLSPACING="2" CELLPADDING="0" WIDTH="100%"><TR>');
writeln('<TD ALIGN=LEFT><INPUT type="button" name="Ver" value="Ver" onClick="FormPaint(this)"></TD>');
writeln('<TD ALIGN=RIGHT><INPUT type="button" name="AlineasMas" value="Más Líneas" onClick="MasLineas(this)"></TD>');
writeln('</TR></TABLE>');
}
writeln('<A NAME="pie-albaran"><CENTER><H2><FONT COLOR="#800040"> Notas </FONT></H2></CENTER></A>');
writeln('<TABLE BORDER=1 ALIGN=CENTER>');
writeln('<TR> <TD ALIGN=RIGHT><B>Observaciones: </B></TD>');
writeln('<FONT COLOR="#800040"><TD ALIGN=LEFT> <TEXTAREA NAME="ab_observaciones" ROWS=4 COLS=30 SIZE=30 maxlength=30 WRAP="virtual">'+request.ab_observaciones+'</TEXTAREA> </TD> </TR>');
writeln('<TD ALIGN=RIGHT><B>Vto. Jefe Obra:</B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.ab_vto_jefe_obra+'</B></FONT><INPUT type="hidden" name="ab_vto_jefe_obra" VALUE="'+request.ab_vto_jefe_obra+'" size=1 maxlength=1></TD></TR>');
else {
if ( request.ab_vto_jefe_obra == "S" ) {
writeln('<TD ALIGN=LEFT><INPUT TYPE="radio" NAME="ab_vto_jefe_obra" VALUE="S" CHECKED>Si');
writeln('<INPUT TYPE="radio" NAME="ab_vto_jefe_obra" VALUE="N" >No </TD></TR>');
}
else {
writeln('<TD ALIGN=LEFT><INPUT TYPE="radio" NAME="ab_vto_jefe_obra" VALUE="S" >Si');
writeln('<INPUT TYPE="radio" NAME="ab_vto_jefe_obra" VALUE="N" CHECKED>No </TD></TR>');
}
}
writeln('<TR><TD ALIGN=RIGHT><B>Vto. Jefe Grupo Obra:</B>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.ab_vto_jefe_grupo+'</B></FONT><INPUT type="hidden" name="ab_vto_jefe_grupo" VALUE="'+request.ab_vto_jefe_grupo+'" size=1 maxlength=1></TD></TR>');
else {
if ( request.ab_vto_jefe_grupo == "S" ) {
writeln('<TD ALIGN=LEFT><INPUT TYPE="radio" NAME="ab_vto_jefe_grupo" VALUE="S" CHECKED>Si');
writeln('<INPUT TYPE="radio" NAME="ab_vto_jefe_grupo" VALUE="N" >No </TD></TR>');
}
else {
writeln('<TD ALIGN=LEFT><INPUT TYPE="radio" NAME="ab_vto_jefe_grupo" VALUE="S" >Si');
writeln('<INPUT TYPE="radio" NAME="ab_vto_jefe_grupo" VALUE="N" CHECKED>No </TD></TR>');
}
}
writeln('<TD ALIGN=RIGHT><B>Conforme Proveedor:</B>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.ab_vto_proveedor+'</B></FONT><INPUT type="hidden" name="ab_vto_proveedor" VALUE="'+request.ab_vto_proveedor+'" size=1 maxlength=1></TD></TR>');
else {
if ( request.ab_vto_proveedor == "S" ) {
writeln('<TD ALIGN=LEFT><INPUT TYPE="radio" NAME="ab_vto_proveedor" VALUE="S" CHECKED>Si');
writeln('<INPUT TYPE="radio" NAME="ab_vto_proveedor" VALUE="N" >No </TD></TR>');
}
else {
writeln('<TD ALIGN=LEFT><INPUT TYPE="radio" NAME="ab_vto_proveedor" VALUE="S" >Si');
writeln('<INPUT TYPE="radio" NAME="ab_vto_proveedor" VALUE="N" CHECKED>No </TD></TR>');
}
}
writeln('<TR><TD ALIGN=RIGHT><B>Expediente:</B></TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.ab_expediente+'</B></FONT><INPUT type="hidden" name="ab_expediente" VALUE="'+request.ab_expediente+'" size=35 maxlength=40></TD></TR>');
else
writeln('<TD><INPUT type="text" name="ab_expediente" VALUE="'+request.ab_expediente+'" size=35 maxlength=40></TD>');
writeln('</TR></TABLE></CENTER>');
writeln('</FORM></FONT>');
if (!request.waux) {
writeSignature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

445
o_apunte.html Normal file
View File

@ -0,0 +1,445 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Apuntes Contables</TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/4.0b1 (Win95; I) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#C0C0C0" LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000" BACKGROUND="images/backgrnd.gif">
<P><!--
Autor : Jesús Pérez Lorenzo
Copyright : 1996 , AdmiSys S.L.
--></P>
<FORM>
<CENTER>
<TABLE ALIGN=CENTER BORDER=6>
<TR>
<TD><A HREF="logout.html?bb=1" target="_top"><IMG SRC="images/bb_logout.gif" ALT="Logout" BORDER=0 HEIGHT=61 WIDTH=66></A></TD>
<TD><INPUT type="submit" value="Confirmar"></TD>
<!--
<TD BGCOLOR="#DFDFDF"><A HREF="cursorback" target="_back"><IMG SRC="images/l_arrowg.gif" ALT="AnteriorFila" BORDER=0 ></A>
-->
</TD>
</TD>
<TD><H1 ALIGN=CENTER><FONT SIZE=+3><FONT COLOR="#008000">APUNTES CONTABLES</FONT><FONT COLOR="#FF00FF">&nbsp;</FONT></FONT></H1></TD>
<!--
<TD BGCOLOR="#DFDFDF"><A HREF="cursornext" target="_next"><IMG SRC="images/r_arrowg.gif" ALT="SiguieteFila" BORDER=0 ></A>
</TD>
-->
<TD ALIGN=RIGHT><INPUT type="reset" value="Deshacer"></TD>
<TD><A HREF="help.html" onClick="NetHelp('intro')">
<IMG SRC="images/bb_help.gif" ALT="Ayuda" BORDER=0 HEIGHT=61 WIDTH=61></A>
</TD>
<!-->
</TR>
</TABLE></CENTER>
<CENTER><HR SIZE=3 WIDTH="100%">
<TABLE BORDER=2 >
<CAPTION></CAPTION>
<TR>
<TH ALIGN=LEFT>
<DT><A HREF="http://ctasapagar"><IMG SRC="images/SGRP.jpg" BORDER=0 HEIGHT=76 WIDTH=86></A>&nbsp;</DT>
</TH>
<TD>
<DT><I><FONT COLOR="#FF0080"><FONT SIZE=+2><B><A HREF="http://ctasapagar/Ctas_a_Pagar">Dpto.
Cuentas a Pagar</A></B>&nbsp;</FONT></FONT></I></DT>
</TD>
<TD>
<DT><B>C&oacute;digo:</B>&nbsp;<INPUT TYPE="text" NAME="NroAlbaran" VALUE="" SIZE=8 ><INPUT TYPE="button" VALUE=" ? " ONCLICK="setNow(this.form.since)"></DT>
</TD>
<TD>
<DT><B>Fecha:</B>&nbsp;<INPUT TYPE="text" NAME="FechaAlbaran" VALUE="" SIZE=8 ><INPUT TYPE="button" VALUE="Hoy" ONCLICK="setNow(this.form.since)"></DT>
</TD>
</TR>
</TABLE>
<DT>&nbsp;</DT>
<TABLE BORDER=3 >
<TR>
<TD>
<DT><B><I><FONT COLOR="#008080">Importe Debe</FONT></I></B></DT>
</TD>
<TD>
<DT><B><I><FONT COLOR="#008080">C&oacute;digo Debe</FONT></I></B></DT>
</TD>
<TD>
<DT><B><I><FONT COLOR="#008080">Cuenta Contable Debe</FONT></I></B></DT>
</TD>
<TD>
<DT><B><I><FONT COLOR="#800040">Cuenta Contable Haber</FONT></I></B></DT>
</TD>
<TD>
<DT><B><I><FONT COLOR="#800040">C&oacute;digo Haber</FONT></I></B></DT>
</TD>
<TD>
<DT><B><I><FONT COLOR="#800040">Importe Haber</FONT></I></B></DT>
</TD>
</TR>
<TR>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin1" VALUE="" SIZE=10 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin1" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin1" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin1" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin1" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin1" VALUE="" SIZE=10 ></DT>
</TD>
</TR>
<TR>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin2" VALUE="" SIZE=10 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin2" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin2" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin2" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin2" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin2" VALUE="" SIZE=10 ></DT>
</TD>
</TR>
<TR>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin3" VALUE="" SIZE=10 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin3" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin3" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin3" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin3" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin3" VALUE="" SIZE=10 ></DT>
</TD>
</TR>
<TR>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin4" VALUE="" SIZE=10 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin4" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin4" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin4" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin4" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin4" VALUE="" SIZE=10 ></DT>
</TD>
</TR>
<TR>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin5" VALUE="" SIZE=10 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin5" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin5" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin5" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin5" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin5" VALUE="" SIZE=10 ></DT>
</TD>
</TR>
<TR>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin6" VALUE="" SIZE=10 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin6" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin61" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin6" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin6" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin6" VALUE="" SIZE=10 ></DT>
</TD>
</TR>
<TR>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin7" VALUE="" SIZE=10 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin7" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin7" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin7" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin7" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin7" VALUE="" SIZE=10 ></DT>
</TD>
</TR>
<TR>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin8 VALUE="" SIZE=10 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin8" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin8" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin8" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin8" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin8" VALUE="" SIZE=10 ></DT>
</TD>
</TR>
<TR>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin9" VALUE="" SIZE=10 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin9" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin9" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin9" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin9" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin9" VALUE="" SIZE=10 ></DT>
</TD>
</TR>
<TR>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin10" VALUE="" SIZE=10 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin10" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin10" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberDesc-lin10" VALUE="" SIZE=20 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberCta-lin10" VALUE="" SIZE=12 ></DT>
</TD>
<TD>
<DT><INPUT TYPE="text" NAME="HaberImp-lin10" VALUE="" SIZE=10 ></DT>
</TD>
</TR>
</TABLE>
<DT>&nbsp;</DT>
<TABLE BORDER=3 >
<TR>
<TD>
<DT><B><I><FONT COLOR="#008080">TOTAL DEBE :</FONT></I></B>&nbsp;<INPUT TYPE="text" NAME="DebeTotal" VALUE="" SIZE=22 ></DT>
</TD>
<TD>
<DT><B><I><FONT COLOR="#800000">TOTAL HABER:</FONT></I></B>&nbsp;<INPUT TYPE="text" NAME="HaberTotal" VALUE="" SIZE=22 ></DT>
</TD>
</TR>
</TABLE>
<P><!--
<TABLE ALIGN=LEFT BORDER=2 >
<TR>
<TH ALIGN=LEFT></TH>
<TD><B>Cuenta Gasto</B> </TD>
<TD><B>Importe</B> </TD>
</TR>
<TR>
<TH ALIGN=LEFT></TH>
<TD><INPUT TYPE="text" NAME="Cta-lin1" VALUE="" SIZE=12 ></TD>
<TD><INPUT TYPE="text" NAME="Importe-lin1" VALUE="" SIZE=16 ></TD>
</TR>
<TR>
<TH ALIGN=LEFT></TH>
<TD><INPUT TYPE="text" NAME="Cta-lin2" VALUE="" SIZE=12 ></TD>
<TD><INPUT TYPE="text" NAME="Importe-lin2" VALUE="" SIZE=16 ></TD>
</TR>
<TR>
<TH ALIGN=LEFT></TH>
<TD><INPUT TYPE="text" NAME="Cta-lin3" VALUE="" SIZE=12 ></TD>
<TD><INPUT TYPE="text" NAME="Importe-lin3" VALUE="" SIZE=16 ></TD>
</TR>
<TR>
<TH ALIGN=LEFT></TH>
<TD><INPUT TYPE="text" NAME="Cta-lin4" VALUE="" SIZE=12 ></TD>
<TD><INPUT TYPE="text" NAME="Importe-lin4" VALUE="" SIZE=16 ></TD>
</TR>
<TR>
<TH ALIGN=LEFT></TH>
<TD><INPUT TYPE="text" NAME="Cta-lin5" VALUE="" SIZE=12 ></TD>
<TD><INPUT TYPE="text" NAME="Importe-lin5" VALUE="" SIZE=16 ></TD>
</TR>
</TABLE>
--></P>
<P><ALIGN=CENTER><TEXTAREA NAME="Observaciones" ROWS=10 COLS=40 WRAP="virtual"></TEXTAREA></P>
<TABLE BORDER=2 >
<TR>
<TD>
<DT><B>Vto. Jefe de Obra:</B>&nbsp;<INPUT TYPE="radio" NAME="VtoJefeObra" VALUE="S"CHECKED>Si&nbsp;<INPUT TYPE="radio" NAME="VtoJefeObra" VALUE="N" >No&nbsp;</DT>
</TD>
<TD>
<DT><B>Vto. Jefe Grupo de Obra:</B>&nbsp;<INPUT TYPE="radio" NAME="VtoJefeGrupoObra" VALUE="S" CHECKED>Si&nbsp;<INPUT TYPE="radio" NAME="VtoJefeGrupoObra" VALUE="N" >No&nbsp;</DT>
</TD>
<TD>
<DT><B>Conforme Proveedor:</B>&nbsp;<INPUT TYPE="radio" NAME="ConformeProveedor" VALUE="S" CHECKED>Si&nbsp;<INPUT TYPE="radio" NAME="ConformeProveedor" VALUE="N" >No&nbsp;</DT>
</TD>
</TR>
</TABLE>
<HR SIZE=3 WIDTH="100%">
<BASE target="contents"><FONT SIZE=-1><B>Contactar con</B>: <ctasapagar></FONT><FONT SIZE=+1><A HREF="mailto:%3Cctasapagar%3Esando_malaga@admisys.com">Departamento
de Cuentas a Pagar<BR>
</A></FONT><FONT SIZE=-1>Copyright &copy; 1997 </FONT><A HREF="mailto:%20%3Cinfo%3Esando_malaga@admisys.com">Construcciones
SANDO SA</A> <FONT SIZE=-1>&amp; </FONT><A HREF="mailto:info@admisys.com">AdmiSys
SL</A><FONT SIZE=-1> <BR>
Rev. 1.0 </FONT><A HREF="mailto:webteam@admisys.com">webteam@admisys.com</A><FONT SIZE=-1> <BR>
</BODY>
</HTML>

506
o_banco.html Normal file
View File

@ -0,0 +1,506 @@
<TITLE>Bancos</TITLE>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>cod_banco</TITLE>
<META NAME="GENERATOR" CONTENT="AdmiSys Sistemas informáticos">
<META NAME="Author" CONTENT="WebTeam">
<META NAME="Organization" CONTENT="AdmiSys S.L.">
<META NAME="Document description" CONTENT="Alta y Modificación de Condiciones de Pago">
<META NAME="Last modified date" CONTENT="Thursday, February 06, 1997 07:33:31">
</HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
function FormPaint(obj) {
document.f_banco.action=top.main.document.location.href+"&cookie=1&lock=true";
document.f_banco.submit();
}
function Chek_fields(obj) {
if ( emptyField(obj.ba_cod_banco) == true ) {
alert("!!! Es necesario rellenar el Código de Banco !!!->"+obj.ba_cod_banco.value+"<-");
return false;
}
return true;
}
</SCRIPT>
<SERVER>
var baseHtml="";
dbAcl();
writeln("<SCRIPT LANGUAGE='JavaScript'>");
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln('function RunFunction(obj,valor,clave,f_nro) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.f_banco;');
writeln(' if ( obj == "Ayuda" ) {');
writeln(' NetHelp(valor);');
writeln(' }');
writeln(' history.back();');
writeln('}');
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
ObjButtons(request.ba_cod_banco,"Bancos","ba_");
}
writeln('}');
}
if ( request.ViewFkey == "S" ) {
writeln('function RePaint(obj) {');
writeln(' var mainFrame=find_frame(top,"top");');
writeln(' for ( var i=0; i < document.f_banco.length; i++ ) { ');
writeln(' if ( document.f_banco.elements[i].name == obj.name ) ');
writeln(' break; ');
writeln(' } ');
writeln(' document.f_banco.action=mainFrame.document.location.href+"&cookie=1&nro="+i+"&lock=true"');
writeln(' document.f_banco.submit();');
writeln('} ');
}
else {
writeln('function RePaint(obj) {');
writeln('} ');
}
writeln('function Enfoca(obj) {')
if ( request.nro ) {
writeln('document.f_banco.elements['+request.nro+'].focus();');
}
writeln('}');
writeln("</SCRIPT>");
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\',\''+request.nvo+'\','+request.nro+')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln('<BODY "');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
if (request.gofunc) {
writeln(' </BODY>');
writeln(' </HTML>');
writeln(' <!--');
}
if (!request.cookie && !request.gofunc) {
dbConnect();
// Vemos que tarea hay que ejecutar:
if (request.add) {
if ( entriesExist(" from bancos where cod_banco=\'"+StringClip(true,request.ba_cod_banco)+"\'") == true ){
redirect("alertpage.html?alert=2");
}
else {
status=database.execute("INSERT INTO bancos(" +
" cod_banco," +
" nombre," +
" acronimo," +
" domicilio," +
" localidad," +
" cod_postal," +
" entidad," +
" sucursal," +
" cod_control," +
" nro_cc," +
" is_locked," +
" nro_lins," +
" l_importe," +
" c_importe," +
" l_paguese," +
" c_paguese," +
" l1_nroletra," +
" c1_nroletra," +
" l2_nroletra," +
" c2_nroletra," +
" l_fecha," +
" c_fecha," +
" c_mes," +
" c_anno," +
" l1_firmado," +
" c1_firmado," +
" l2_firmado," +
" c2_firmado," +
" t1_firmado," +
" t2_firmado) VALUES ('" + StringClip(true,request.ba_cod_banco) + "','" +
StringClip(true,request.ba_nombre) + "','"+
StringClip(true,request.ba_acronimo) + "','"+
StringClip(true,request.ba_domicilio) + "','" +
StringClip(true,request.ba_localidad) + "','" +
StringClip(true,request.ba_cod_postal) + "','" +
StringClip(true,request.ba_entidad) + "','" +
StringClip(true,request.ba_sucursal) + "','" +
StringClip(true,request.ba_cod_control) + "','" +
StringClip(true,request.ba_nro_cc) + "','" +
request.ba_is_locked + "','" +
parseInt(request.ba_nro_lins)+ "','" +
parseInt(request.ba_l_importe)+ "','" +
parseInt(request.ba_c_importe)+ "','" +
parseInt(request.ba_l_paguese)+ "','" +
parseInt(request.ba_c_paguese)+ "','" +
parseInt(request.ba_l1_nroletra)+ "','" +
parseInt(request.ba_c1_nroletra)+ "','" +
parseInt(request.ba_l2_nroletra)+ "','" +
parseInt(request.ba_c2_nroletra)+ "','" +
parseInt(request.ba_l_fecha)+ "','" +
parseInt(request.ba_c_fecha)+ "','" +
parseInt(request.ba_c_mes)+ "','" +
parseInt(request.ba_c_anno)+ "','" +
parseInt(request.ba_l1_firmado)+ "','" +
parseInt(request.ba_c1_firmado)+ "','" +
parseInt(request.ba_l2_firmado)+ "','" +
parseInt(request.ba_c2_firmado)+ "','"+
StringClip(true,request.ba_t1_firmado)+ "','" +
StringClip(true,request.ba_t2_firmado) + "')");
if ( status != 0 )
redirect(addClient('error.html?alert=5'));
DbsError(true,status);
}
redirect(addClient("o_banco.html?nvo=1&"+baseHtml));
}
//Ejecuta una actualización de la fila sobre la fila actual ...
if (request.upd && request.ba_cod_banco) {
// if (request.lock)
// c_bancos.close();
status=database.execute("UPDATE bancos SET "+
" nombre='" + StringClip(true,request.ba_nombre) + "',"+
" acronimo='" + StringClip(true,request.ba_acronimo) + "',"+
" domicilio='" + StringClip(true,request.ba_domicilio) + "'," +
" localidad='" + StringClip(true,request.ba_localidad) + "'," +
" cod_postal='" + StringClip(true,request.ba_cod_postal) + "'," +
" entidad='" + StringClip(true,request.ba_entidad) + "'," +
" sucursal='" + StringClip(true,request.ba_sucursal) + "'," +
" cod_control='" + StringClip(true,request.ba_cod_control) + "'," +
" nro_cc='" + StringClip(true,request.ba_nro_cc) + "'," +
" is_locked='" + request.ba_is_locked + "'," +
" nro_lins='" + parseInt(request.ba_nro_lins) + "'," +
" l_importe='" + parseInt(request.ba_l_importe)+ "'," +
" c_importe='" + parseInt(request.ba_c_importe)+ "'," +
" l_paguese='" + parseInt(request.ba_l_paguese)+ "'," +
" c_paguese='" + parseInt(request.ba_c_paguese)+ "'," +
" l1_nroletra='" + parseInt(request.ba_l1_nroletra)+ "'," +
" c1_nroletra='" + parseInt(request.ba_c1_nroletra)+ "'," +
" l2_nroletra='" + parseInt(request.ba_l2_nroletra)+ "'," +
" c2_nroletra='" + parseInt(request.ba_c2_nroletra)+ "'," +
" l_fecha='" + parseInt(request.ba_l_fecha)+ "'," +
" c_fecha='" + parseInt(request.ba_c_fecha)+ "'," +
" c_mes='" + parseInt(request.ba_c_mes)+ "'," +
" c_anno='" + parseInt(request.ba_c_anno)+ "'," +
" l1_firmado='" + parseInt(request.ba_l1_firmado)+ "'," +
" c1_firmado='" + parseInt(request.ba_c1_firmado)+ "'," +
" l2_firmado='" + parseInt(request.ba_l2_firmado)+ "'," +
" c2_firmado='" + parseInt(request.ba_c2_firmado)+ "'," +
" t1_firmado='" + StringClip(true,request.ba_t1_firmado)+ "'," +
" t2_firmado='" + StringClip(true,request.ba_t2_firmado) + "'" +
" WHERE cod_banco = '" + request.ba_cod_banco + "'" );
if ( status != 0 )
redirect(addClient('error.html?alert=6'));
DbsError(true,status);
redirect(addClient("g_banco.html?"+baseHtml));
}
//Ejecuta un borrado de la fila actual ...
if (request.del) {
status=database.execute("DELETE FROM bancos WHERE cod_banco = \'" + request.ba_cod_banco + "\'");
if ( status != 0 )
redirect(addClient('error.html?alert=7'));
DbsError(true,status);
redirect(addClient("g_banco.html?"+baseHtml));
}
if (request.ba_cod_banco && !request.upd && !request.add ) {
// Si hay Clave de la tabla seleccionamos los datos ....
//Si se busca la fila ... usando la clave primaria de la relación
if (request.lock)
CursorTabla("ba","cod_banco","=\'"+request.ba_cod_banco+"\'",true,true);
else
CursorTabla("ba","cod_banco","=\'"+request.ba_cod_banco+"\'",true,"");
// Asignamos a request todas las columnas necesarias para el form.
request.ba_cod_banco=StringClip(false,c_bancos.cod_banco);
request.ba_nombre=StringClip(false,c_bancos.nombre);
request.ba_acronimo=StringClip(false,c_bancos.acronimo);
request.ba_domicilio=StringClip(false,c_bancos.domicilio);
request.ba_localidad=StringClip(false,c_bancos.localidad);
request.ba_cod_postal=StringClip(false,c_bancos.cod_postal);
request.ba_entidad=StringClip(false,c_bancos.entidad);
request.ba_sucursal=StringClip(false,c_bancos.sucursal);
request.ba_cod_control=StringClip(false,c_bancos.cod_control);
request.ba_nro_cc=StringClip(false,c_bancos.nro_cc);
request.ba_is_locked=StringClip(false,c_bancos.is_locked);
request.ba_nro_lins=parseInt(c_bancos.nro_lins);
request.ba_l_importe=parseInt(c_bancos.l_importe);
request.ba_c_importe=parseInt(c_bancos.c_importe);
request.ba_l_paguese=parseInt(c_bancos.l_paguese);
request.ba_c_paguese=parseInt(c_bancos.c_paguese);
request.ba_l1_nroletra=parseInt(c_bancos.l1_nroletra);
request.ba_c1_nroletra=parseInt(c_bancos.c1_nroletra);
request.ba_l2_nroletra=parseInt(c_bancos.l2_nroletra);
request.ba_c2_nroletra=parseInt(c_bancos.c2_nroletra);
request.ba_l_fecha=parseInt(c_bancos.l_fecha);
request.ba_c_fecha=parseInt(c_bancos.c_fecha);
request.ba_c_mes=parseInt(c_bancos.c_mes);
request.ba_c_anno=parseInt(c_bancos.c_anno);
request.ba_l1_firmado=parseInt(c_bancos.l1_firmado);
request.ba_c1_firmado=parseInt(c_bancos.c1_firmado);
request.ba_l2_firmado=parseInt(c_bancos.l2_firmado);
request.ba_c2_firmado=parseInt(c_bancos.c2_firmado);
request.ba_t1_firmado=StringClip(true,c_bancos.t1_firmado);
request.ba_t2_firmado=StringClip(true,c_bancos.t2_firmado);
if (!request.lock)
c_bancos.close();
}
else {
// Estos son los Defaults Reales del Form ... Aquí pueden cambiarse ...
IniciaRequest("ba_");
request.lock=true;
}
}
else if (!request.gofunc) {
// Se entiende que request contiene todas las columnas necesarias para el form.
// y que esta llamada es para leer y cargar las claves foráneas de la tabla.
if (request.nvo && request.ba_cod_banco && request.ba_cod_banco != null ) {
if ( entriesExist(" from bancos where cod_banco=\'"+StringClip(true,request.ba_cod_banco)+"\'") == true ) {
redirect("alertpage.html?alert=2");
}
}
}
writeln('<FORM NAME="f_banco" METHOD="post"');
if (request.ba_cod_banco && !request.nvo )
htmlpath="o_banco.html?ba_cod_banco="+escape(request.ba_cod_banco)+"&"+baseHtml;
else
htmlpath="o_banco.html?nvo=1&"+baseHtml;
writeln('action="'+htmlpath+'"');
writeln(' onSubmit="return Chek_fields(this)">');
LoadHidden(htmlpath);
if (!request.waux && request.FrameType == "L" )
ObjHeadBar(request.ba_cod_banco,"Bancos","ba_");
writeln(' <CENTER>');
writeln(' <TABLE BORDER=1 ALIGN=CENTER><TR>');
//if (!request.waux)
// writeln('<TD ALIGN=RIGHT><INPUT TYPE="button" VALUE=" Código " ONCLICK="w_auxiliar(\'cod_banco\',\'cod_banco\',\'ba_cod_banco\',\''+request.ba_cod_banco+'\')">');
//else {
//if (request.waux == 2)
// writeln('<TD></TD><TD align="right" valign="top"><A HREF="javascript:top.close()"><IMG SRC="images/exit1.gif" BORDER=0 HEIGHT=37 WIDTH=44></A></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B> C&oacute;digo: </B>');
//}
if (request.ba_cod_banco && !request.nvo)
writeln('<FONT COLOR="#800040"><B>'+request.ba_cod_banco+'</B></FONT><INPUT type="hidden" name="ba_cod_banco" VALUE="'+request.ba_cod_banco+'"></TD>');
else
writeln('<INPUT TYPE="text" NAME="ba_cod_banco" VALUE="'+request.ba_cod_banco+'" SIZE=4 OnChange="RePaint(this)"></TD>');
writeln('<TD ALIGN=RIGTH>');
if (request.waux || !request.lock)
writeln('<FONT COLOR="#800040"><B>'+request.ba_nombre+'</FONT></B><INPUT type="hidden" NAME="ba_nombre" VALUE="'+request.ba_nombre+'" SIZE=40 maxlength=40 ></TD></TR>');
else
writeln('<INPUT TYPE="text" NAME="ba_nombre" VALUE="'+request.ba_nombre+'" SIZE=40 maxlength=40 ></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B>Acrónimo:</B></TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_acronimo+'</FONT></B><INPUT type="hidden" NAME="ba_acronimo" VALUE="'+request.ba_acronimo+'" SIZE=40 maxlength=40 ></TD></TR>');
else
writeln('<TD><INPUT TYPE="text" NAME="ba_acronimo" VALUE="'+request.ba_acronimo+'" SIZE=40 maxlength=40 ></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B>Domicilio:</B></TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_domicilio+'</FONT><INPUT type="hidden" name="ba_domicilio" VALUE="'+request.ba_domicilio+'" size=40 maxlength=40></TD></TR>');
else
writeln('<TD><INPUT type="text" name="ba_domicilio" VALUE="'+request.ba_domicilio+'" size=40 maxlength=40></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B>Localidad:</B></TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_localidad+'</FONT><INPUT type="hidden" name="ba_localidad" VALUE="'+request.ba_localidad+'" size=25 maxlength=25></TD></TR>');
else
writeln('<TD><INPUT type="text" name="ba_localidad" VALUE="'+request.ba_localidad+'" size=25 maxlength=25></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B>Cod.Postal:</B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.ba_cod_postal+'</FONT><INPUT type="hidden" name="ba_cod_postal" VALUE="'+request.ba_cod_postal+'" size=7 maxlength=7></TD><TR>');
else
writeln('<TD ALIGN=LEFT><INPUT type="text" name="ba_cod_postal" VALUE="'+request.ba_cod_postal+'" size=7 maxlength=7></TD><TR>');
writeln('<TR><TD ALIGN=RIGHT><B>Entidad:</B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.ba_entidad+'</FONT><INPUT type="hidden" name="ba_entidad" VALUE="'+request.ba_entidad+'" size=4 ></TD><TR>');
else
writeln('<TD ALIGN=LEFT><INPUT type="text" name="ba_entidad" VALUE="'+request.ba_entidad+'" size=4 ></TD><TR>');
writeln('<TR><TD ALIGN=RIGHT><B>Sucursal:</B></TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_sucursal+'</FONT><INPUT type="hidden" name="ba_sucursal" VALUE="'+request.ba_sucursal+'" size=4 maxlength=4></TD></TR>');
else
writeln('<TD><INPUT type="text" name="ba_sucursal" VALUE="'+request.ba_sucursal+'" size=4 maxlength=4></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B>Cod. Control:</B></TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_cod_control+'</FONT><INPUT type="hidden" name="ba_cod_control" VALUE="'+request.ba_cod_control+'" size=2 maxlength=2></TD></TR>');
else
writeln('<TD><INPUT type="text" name="ba_cod_control" VALUE="'+request.ba_cod_control+'" size=2 maxlength=2></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT> <B>Nro. Cuenta:</B> ');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_nro_cc+'<B></FONT><INPUT TYPE="hidden" NAME="ba_nro_cc" VALUE="'+request.ba_nro_cc+'"></TD>');
else {
writeln('<TD> <INPUT TYPE="text" NAME="ba_nro_cc" size=10 VALUE="'+request.ba_nro_cc+'"');
writeln(' onFocus="setStatus(\'\')"');
writeln(' SIZE=3 </TD></TR>');
}
writeln('<TR><TD ALIGN=RIGHT> <B>Bloqueado:</B> ');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_is_locked+'<B></FONT><INPUT TYPE="hidden" NAME="ba_id_locked" VALUE="'+request.ba_is_locked+'"></TD>');
else {
writeln('<TD> <INPUT TYPE="text" NAME="ba_is_locked" size=2 VALUE="'+request.ba_is_locked+'"');
writeln(' onFocus="setStatus(\'\')"');
writeln(' SIZE=3 </TD></TR>');
}
writeln('</TABLE>');
writeln('<CENTER><H3><B>Formato de Talón</H3></B> ');
writeln('<TABLE BORDER=1 ALIGN=CENTER>');
writeln('<TR><TD ALIGN=CENTER><B>Nro. Líns. Talón:</B> ');
if (request.waux || !request.lock) {
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_nro_lins+'<B></FONT><INPUT TYPE="hidden" NAME="ba_nro_lins" VALUE="'+request.ba_nro_lins+'">');
writeln('</TD>');
}
else {
writeln('<TD> <INPUT TYPE="text" NAME="ba_nro_lins" VALUE="'+request.ba_nro_lins+'"');
writeln(' onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" SIZE=2 >');
writeln(' </TR>');
}
writeln('<TR><TD ALIGN=RIGHT> <B>Lín. y Col. Importe:</B> ');
if (request.waux || !request.lock) {
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_l_importe+'<B></FONT><INPUT TYPE="hidden" NAME="ba_l_importe" VALUE="'+request.ba_l_importe+'">');
writeln('<FONT COLOR="#800040"><B>'+request.ba_c_importe+'<B></FONT><INPUT TYPE="hidden" NAME="ba_c_importe" VALUE="'+request.ba_c_importe+'">');
writeln('</TD>');
}
else {
writeln('<TD> <INPUT TYPE="text" NAME="ba_l_importe" VALUE="'+request.ba_l_importe+'"');
writeln(' onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" SIZE=2 >');
writeln('<INPUT TYPE="text" NAME="ba_c_importe" VALUE="'+request.ba_c_importe+'"');
writeln(' onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" SIZE=2 ></TD>');
writeln(' </TR>');
}
writeln('<TR><TD ALIGN=RIGHT> <B>Lín. y Col. Páguese:</B> ');
if (request.waux || !request.lock) {
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_l_paguese+'<B></FONT><INPUT TYPE="hidden" NAME="ba_l_paguese" VALUE="'+request.ba_l_paguese+'">');
writeln('<FONT COLOR="#800040"><B>'+request.ba_c_paguese+'<B></FONT><INPUT TYPE="hidden" NAME="ba_c_paguese" VALUE="'+request.ba_c_paguese+'">');
writeln('</TD>');
}
else {
writeln('<TD> <INPUT TYPE="text" NAME="ba_l_paguese" VALUE="'+request.ba_l_paguese+'"');
writeln(' onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" SIZE=2>');
writeln('<INPUT TYPE="text" NAME="ba_c_paguese" VALUE="'+request.ba_c_paguese+'"');
writeln(' onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" SIZE=2></TD>');
writeln(' </TR>');
}
writeln('<TR><TD ALIGN=RIGHT> <B>1.- Lín. y Col. Nro. Letra:</B> ');
if (request.waux || !request.lock) {
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_l1_nroletra+'<B></FONT><INPUT TYPE="hidden" NAME="ba_l1_nroletra" VALUE="'+request.ba_l1_nroletra+'">');
writeln('<FONT COLOR="#800040"><B>'+request.ba_c1_nroletra+'<B></FONT><INPUT TYPE="hidden" NAME="ba_c1_nroletra" VALUE="'+request.ba_c1_nroletra+'">');
writeln('</TD>');
}
else {
writeln('<TD> <INPUT TYPE="text" NAME="ba_l1_nroletra" VALUE="'+request.ba_l1_nroletra+'"');
writeln(' onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" SIZE=2> ');
writeln('<INPUT TYPE="text" NAME="ba_c1_nroletra" VALUE="'+request.ba_c1_nroletra+'"');
writeln(' onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" SIZE=2> </TD>');
writeln(' </TR>');
}
writeln('<TR><TD ALIGN=RIGHT> <B>2.- Lín. y Col. Nro. Letra:</B> ');
if (request.waux || !request.lock) {
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_l2_nroletra+'<B></FONT><INPUT TYPE="hidden" NAME="ba_l2_nroletra" VALUE="'+request.ba_l2_nroletra+'">');
writeln('<FONT COLOR="#800040"><B>'+request.ba_c2_nroletra+'<B></FONT><INPUT TYPE="hidden" NAME="ba_c2_nroletra" VALUE="'+request.ba_c2_nroletra+'">');
writeln('</TD>');
}
else {
writeln('<TD> <INPUT TYPE="text" NAME="ba_l2_nroletra" VALUE="'+request.ba_l2_nroletra+'"');
writeln(' onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" SIZE=2> ');
writeln('<INPUT TYPE="text" NAME="ba_c2_nroletra" VALUE="'+request.ba_c2_nroletra+'"');
writeln(' onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" SIZE=2> </TD>');
writeln(' </TR>');
}
writeln('<TR><TD ALIGN=RIGHT> <B>Fecha:</B> ');
if (request.waux || !request.lock) {
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_l_fecha+'<B></FONT><INPUT TYPE="hidden" NAME="ba_l_fecha" VALUE="'+request.ba_l_fecha+'">');
writeln('<FONT COLOR="#800040"><B>'+request.ba_c_fecha+'<B></FONT><INPUT TYPE="hidden" NAME="ba_c_fecha" VALUE="'+request.ba_c_fecha+'">');
writeln('</TD>');
}
else {
writeln('<TD> <INPUT TYPE="text" NAME="ba_l_fecha" VALUE="'+request.ba_l_fecha+'"');
writeln(' onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" SIZE=2> ');
writeln('<INPUT TYPE="text" NAME="ba_c_fecha" VALUE="'+request.ba_c_fecha+'"');
writeln(' onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" SIZE=2> </TD>');
writeln(' </TR>');
}
writeln('<TR><TD ALIGN=RIGHT> <B>Mes:</B> ');
if (request.waux || !request.lock) {
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_l_fecha+'<B></FONT>');
writeln('<FONT COLOR="#800040"><B>'+request.ba_c_mes+'<B></FONT><INPUT TYPE="hidden" NAME="ba_c_mes" VALUE="'+request.ba_c_mes+'">');
writeln('</TD>');
}
else {
writeln('<TD>---');
writeln(' <INPUT TYPE="text" NAME="ba_c_mes" VALUE="'+request.ba_c_mes+'"');
writeln(' onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" SIZE=2> </TD>');
writeln(' </TR>');
}
writeln('<TR><TD ALIGN=RIGHT> <B>Año:</B> ');
if (request.waux || !request.lock) {
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_l_fecha+'<B></FONT>');
writeln('<FONT COLOR="#800040"><B>'+request.ba_c_anno+'<B></FONT><INPUT TYPE="hidden" NAME="ba_c_anno" VALUE="'+request.ba_c_anno+'">');
writeln('</TD>');
}
else {
writeln('<TD>---');
writeln('<INPUT TYPE="text" NAME="ba_c_anno" VALUE="'+request.ba_c_anno+'"');
writeln(' onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" SIZE=2> </TD>');
writeln(' </TR>');
}
writeln('<TR><TD ALIGN=RIGHT> <B>1.- Firmado:</B> ');
if (request.waux || !request.lock) {
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_l1_firmado+'<B></FONT><INPUT TYPE="hidden" NAME="ba_l1_firmado" VALUE="'+request.ba_l1_firmado+'">');
writeln('<FONT COLOR="#800040"><B>'+request.ba_c1_firmado+'<B></FONT><INPUT TYPE="hidden" NAME="ba_c1_firmado" VALUE="'+request.ba_c1_firmado+'"></TD>');
writeln('</TD>');
}
else {
writeln('<TD> <INPUT TYPE="text" NAME="ba_l1_firmado" VALUE="'+request.ba_l1_firmado+'"');
writeln(' onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" SIZE=2>');
writeln('<INPUT TYPE="text" NAME="ba_c1_firmado" VALUE="'+request.ba_c1_firmado+'"');
writeln(' onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" SIZE=2></TD>');
writeln(' </TR>');
}
writeln('<TR><TD ALIGN=RIGHT> <B>1.- Texto Firmado:</B> ');
if (request.waux || !request.lock) {
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_t1_firmado+'<B></FONT><INPUT TYPE="hidden" NAME="ba_t1_firmado" VALUE="'+request.ba_t1_firmado+'">');
writeln('</TD>');
}
else {
writeln('<TD> <INPUT TYPE="text" NAME="ba_t1_firmado" VALUE="'+request.ba_t1_firmado+'"');
writeln(' SIZE=40 maxlength=40> </TD>');
writeln(' </TR>');
}
writeln('<TR><TD ALIGN=RIGHT> <B>2.- Firmado:</B> ');
if (request.waux || !request.lock) {
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_l2_firmado+'<B></FONT><INPUT TYPE="hidden" NAME="ba_l2_firmado" VALUE="'+request.ba_l2_firmado+'">');
writeln('<FONT COLOR="#800040"><B>'+request.ba_c2_firmado+'<B></FONT><INPUT TYPE="hidden" NAME="ba_c2_firmado" VALUE="'+request.ba_c2_firmado+'">');
writeln('</TD>');
}
else {
writeln('<TD> <INPUT TYPE="text" NAME="ba_l2_firmado" VALUE="'+request.ba_l2_firmado+'"');
writeln(' onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" SIZE=2>');
writeln('<INPUT TYPE="text" NAME="ba_c2_firmado" VALUE="'+request.ba_c2_firmado+'"');
writeln(' onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" SIZE=2> </TD>');
writeln(' </TR>');
}
writeln('<TR><TD ALIGN=RIGHT> <B>2.- Texto Firmado:</B> ');
if (request.waux || !request.lock) {
writeln('<TD><FONT COLOR="#800040"><B>'+request.ba_t2_firmado+'<B></FONT><INPUT TYPE="hidden" NAME="ba_c2_firmado" VALUE="'+request.ba_t2_firmado+'">');
writeln('</TD>');
}
else {
writeln('<TD> <INPUT TYPE="text" NAME="ba_t2_firmado" VALUE="'+request.ba_t2_firmado+'"');
writeln(' SIZE=40 maxlength=40> </TD>');
writeln(' </TR>');
}
writeln('</TABLE></FORM>');
if (!request.waux) {
writeSignature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

205
o_centro.html Normal file
View File

@ -0,0 +1,205 @@
<TITLE>centros</TITLE>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Centros</TITLE>
<META NAME="GENERATOR" CONTENT="AdmiSys Sistemas informáticos">
<META NAME="Author" CONTENT="WebTeam">
<META NAME="Organization" CONTENT="AdmiSys S.L.">
<META NAME="Document description" CONTENT="Alta y Modificación de Centros">
<META NAME="Last modified date" CONTENT="Thursday, February 06, 1997 07:33:31">
</HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
function FormPaint(obj) {
document.f_centro.action=top.main.document.location.href+"&cookie=1&lock=true";
document.f_centro.submit();
}
function Chek_fields(obj) {
if ( emptyField(obj.ce_cod_centro) == true ) {
alert("!!! Es necesario rellenar el Código de centro !!!->"+obj.ce_cod_centro.value+"<-");
return false;
}
return true;
}
</SCRIPT>
<SERVER>
var baseHtml="";
dbAcl();
writeln("<SCRIPT LANGUAGE='JavaScript'>");
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln('function RunFunction(obj,valor,clave,f_nro) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.f_centro;');
writeln(' if ( obj == "Ayuda" ) {');
writeln(' NetHelp(valor);');
writeln(' }');
writeln(' history.back();');
writeln('}');
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
ObjButtons(request.ce_cod_centro,"Centros","ce_");
}
writeln('}');
}
if ( request.ViewFkey == "S" ) {
writeln('function RePaint(obj) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' for ( var i=0; i < document.f_centro.length; i++ ) { ');
writeln(' if ( document.f_centro.elements[i].name == obj.name ) ');
writeln(' break; ');
writeln(' } ');
writeln(' document.f_centro.action=top.main.document.location.href+"&cookie=1&nro="+i+"&lock=true"');
writeln(' document.f_centro.submit();');
writeln('} ');
}
else {
writeln('function RePaint(obj) {');
writeln('} ');
}
writeln('function Enfoca(obj) {')
if ( request.nro ) {
writeln('document.f_centro.elements['+request.nro+'].focus();');
}
writeln('}');
writeln("</SCRIPT>");
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\',\''+request.nvo+'\','+request.nro+')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln('<BODY "');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
if (request.gofunc) {
writeln(' </BODY>');
writeln(' </HTML>');
writeln(' <!--');
}
if (!request.cookie && !request.gofunc) {
dbConnect();
// Vemos que tarea hay que ejecutar:
if (request.add) {
if ( entriesExist(" from centros where cod_centro=\'"+StringClip(true,request.ce_cod_centro)+"\'") == true ){
redirect("alertpage.html?alert=2");
}
else {
status=database.execute("INSERT INTO centros(" +
" cod_centro," +
" cod_departamento," +
" descripcion) VALUES ('" + StringClip(true,request.ce_cod_centro) + "','" +
StringClip(true,request.ce_cod_departamento) + "','"+
StringClip(true,request.ce_descripcion) + "')");
if ( status != 0 )
redirect(addClient('error.html?alert=5'));
DbsError(true,status);
}
redirect(addClient("o_centro.html?nvo=1&"+baseHtml));
}
//Ejecuta una actualización de la fila sobre la fila actual ...
if (request.upd && request.ce_cod_centro) {
// if (request.lock)
// c_centros.close();
status=database.execute("UPDATE centros SET "+
" cod_departamento='" + StringClip(true,request.ce_cod_departamento) + "',"+
" descripcion='" + StringClip(true,request.ce_descripcion) + "'"+
" WHERE cod_centro = '" + request.ce_cod_centro + "'" );
if ( status != 0 )
redirect(addClient('error.html?alert=6'));
DbsError(true,status);
redirect(addClient("g_centro.html?"+baseHtml));
}
//Ejecuta un borrado de la fila actual ...
if (request.del) {
status=database.execute("DELETE FROM centros WHERE cod_centro = \'" + request.ce_cod_centro + "\'");
if ( status != 0 )
redirect(addClient('error.html?alert=7'));
DbsError(true,status);
redirect(addClient("g_centro.html?"+baseHtml));
}
if (request.ce_cod_centro && !request.upd && !request.add ) {
// Si hay Clave de la tabla seleccionamos los datos ....
//Si se busca la fila ... usando la clave primaria de la relación
if (request.lock)
CursorTabla("ce","cod_centro","=\'"+request.ce_cod_centro+"\'",true,true);
else
CursorTabla("ce","cod_centro","=\'"+request.ce_cod_centro+"\'",true,"");
// Asignamos a request todas las columnas necesarias para el form.
request.ce_cod_centro=StringClip(false,c_centros.cod_centro);
request.ce_cod_departamento=StringClip(false,c_centros.cod_departamento);
request.ce_descripcion=StringClip(false,c_centros.descripcion);
if (request.lock)
c_centros.close();
}
else {
// Estos son los Defaults Reales del Form ... Aquí pueden cambiarse ...
IniciaRequest("ce_");
request.lock=true;
}
}
else if (!request.gofunc) {
// Se entiende que request contiene todas las columnas necesarias para el form.
// y que esta llamada es para leer y cargar las claves foráneas de la tabla.
if (request.nvo && request.ce_cod_centro && request.ce_cod_centro != null ) {
if ( entriesExist(" from centros where cod_centro=\'"+StringClip(true,request.ce_cod_centro)+"\'") == true ) {
redirect("alertpage.html?alert=2");
}
}
}
writeln('<FORM NAME="f_centro" METHOD="post"');
if (request.ce_cod_centro && !request.nvo)
htmlpath="o_centro.html?ce_cod_centro="+escape(request.ce_cod_centro)+"&"+baseHtml;
else
htmlpath="o_centro.html?nvo=1"+baseHtml;
writeln('action="'+htmlpath+'"');
writeln(' onSubmit="return Chek_fields(this)">');
LoadHidden(htmlpath);
if (!request.waux && request.FrameType == "L" )
ObjHeadBar(request.ce_cod_centro,"Centros","ce_");
writeln(' <CENTER>');
writeln(' <TABLE BORDER=1 ALIGN=CENTER><TR>');
//if (!request.waux)
// writeln('<TD ALIGN=RIGHT><INPUT TYPE="button" VALUE=" Código " ONCLICK="w_auxiliar(\'cod_centro\',\'cod_centro\',\'ce_cod_centro\',\''+request.ce_cod_centro+'\')">');
//else {
//if (request.waux == 2)
// writeln('<TD></TD><TD align="right" valign="top"><A HREF="javascript:top.close()"><IMG SRC="images/exit1.gif" BORDER=0 HEIGHT=37 WIDTH=44></A></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B> C&oacute;digo: </B></TD>');
//}
if (request.ce_cod_centro && !request.nvo)
writeln('<TD><FONT COLOR="#800040"><B>'+request.ce_cod_centro+'</B></FONT><INPUT type="hidden" name="ce_cod_centro" VALUE="'+request.ce_cod_centro+'"></TD></FONT>');
else
writeln('<TD><INPUT TYPE="text" NAME="ce_cod_centro" VALUE="'+request.ce_cod_centro+'" SIZE=5 OnChange="RePaint(this)"></TD>');
writeln('<TR><TD ALIGN=RIGHT><B>Departamento:</B></TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.ce_cod_departamento+'</FONT><INPUT type="hidden" name="ce_cod_departamento" VALUE="'+request.ce_cod_departamento+'" size=12 maxlength=12></TD></FONT></TR>');
else
writeln('<TD><INPUT type="text" name="ce_cod_departamento" VALUE="'+request.ce_cod_departamento+'" size=12 maxlength=12></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B>Descripción:</B></TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.ce_descripcion+'</FONT><INPUT type="hidden" name="ce_descripcion" VALUE="'+request.ce_descripcion+'" size=40 maxlength=40></TD></FONT></TR>');
else
writeln('<TD><INPUT type="text" name="ce_descripcion" VALUE="'+request.ce_descripcion+'" size=40 maxlength=40></TD></TR>');
// writeln(' onFocus="setStatus(\'\')"');
writeln('</TABLE></FORM>');
if (!request.waux) {
writeSignature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

186
o_clave.html Normal file
View File

@ -0,0 +1,186 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>cod_clave</TITLE>
<META NAME="GENERATOR" CONTENT="AdmiSys Sistemas informáticos">
<META NAME="Author" CONTENT="WebTeam">
<META NAME="Organization" CONTENT="AdmiSys S.L.">
<META NAME="Document description" CONTENT="Alta y Modificación de Claves Contables">
<META NAME="Last modified date" CONTENT="Thursday, February 06, 1997 07:33:31">
</HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
function FormPaint(obj) {
document.f_clave.action=top.main.document.location.href+"&cookie=1&lock=true";
document.f_clave.submit();
}
function Chek_fields(obj) {
if ( emptyField(obj.cv_cod_clave) == true ) {
alert("!!! Es necesario rellenar el Código de Claves a Contables !!!->"+obj.cv_cod_clave.value+"<-");
return false;
}
return true;
}
</SCRIPT>
<SERVER>
var baseHtml="";
dbAcl();
writeln("<SCRIPT LANGUAGE='JavaScript'>");
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln('function RunFunction(obj,valor,clave,f_nro) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.f_clave;');
writeln(' if ( obj == "Ayuda" ) {');
writeln(' NetHelp(valor);');
writeln(' }');
writeln(' history.back();');
writeln('}');
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
ObjButtons(request.cv_cod_clave,"Claves","cv_");
}
writeln('}');
}
if ( request.ViewFkey == "S" ) {
writeln('function RePaint(obj) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' for ( var i=0; i < document.f_clave.length; i++ ) { ');
writeln(' if ( document.f_clave.elements[i].name == obj.name ) ');
writeln(' break; ');
writeln(' } ');
writeln(' document.f_clave.action=mainFrame.document.location.href+"&cookie=1&nro="+i+"&lock=true"');
writeln(' document.f_clave.submit();');
writeln('} ');
}
else {
writeln('function RePaint(obj) {');
writeln('} ');
}
writeln('function Enfoca(obj) {')
if ( request.nro ) {
writeln('document.f_clave.elements['+request.nro+'].focus();');
}
writeln('}');
writeln("</SCRIPT>");
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\',\''+request.nvo+'\','+request.nro+')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln(' <BODY');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
if (request.gofunc) {
writeln(' </BODY>');
writeln(' </HTML>');
writeln(' <!--');
}
if (!request.cookie && !request.gofunc) {
dbConnect();
// Vemos que tarea hay que ejecutar:
if (request.add) {
if ( entriesExist(" from claves where cod_clave=\'"+StringClip(true,request.cv_cod_clave)+"\'") == true ){
redirect("alertpage.html?alert=2");
}
else {
status=database.execute("INSERT INTO claves (" +
" cod_clave," +
" descripcion ) VALUES ('" + StringClip(true,request.cv_cod_clave) + "','" +
StringClip(true,request.cv_descripcion) + "')");
if ( status != 0 )
redirect(addClient('error.html?alert=5'));
DbsError(true,status);
}
redirect(addClient("o_clave.html?nvo=1&"+baseHtml));
}
//Ejecuta una actualización de la fila sobre la fila actual ...
if (request.upd && request.cv_cod_clave) {
// if (request.lock)
// c_claves.close();
status=database.execute("UPDATE claves SET "+
" descripcion='" + StringClip(true,request.cv_descripcion) + "'"+
" WHERE cod_clave = '" + request.cv_cod_clave + "'" );
if ( status != 0 )
redirect(addClient('error.html?alert=6'));
DbsError(true,status);
redirect(addClient("g_clave.html?"+baseHtml));
}
//Ejecuta un borrado de la fila actual ...
if (request.del) {
status=database.execute("DELETE FROM claves WHERE cod_clave = \'" + request.cv_cod_clave + "\'");
if ( status != 0 )
redirect(addClient('error.html?alert=7'));
DbsError(true,status);
redirect(addClient("g_clave.html?"+baseHtml));
}
if (request.cv_cod_clave && !request.upd && !request.add ) {
// Si hay Clave de la tabla seleccionamos los datos ....
//Si se busca la fila ... usando la clave primaria de la relación
if (request.lock)
CursorTabla("cv","cod_clave","=\'"+request.cv_cod_clave+"\'",true,true);
else
CursorTabla("cv","cod_clave","=\'"+request.cv_cod_clave+"\'",true,"");
// Asignamos a request todas las columnas necesarias para el form.
request.cv_cod_clave=StringClip(false,c_claves.cod_clave);
request.cv_descripcion=StringClip(false,c_claves.descripcion);
if (!request.lock)
c_claves.close();
}
else {
// Estos son los Defaults Reales del Form ... Aquí pueden cambiarse ...
IniciaRequest("cv_");
request.lock=true;
}
}
else if (!request.gofunc) {
// Se entiende que request contiene todas las columnas necesarias para el form.
// y que esta llamada es para leer y cargar las claves foráneas de la tabla.
if (request.nvo && request.cv_cod_clave && request.cv_cod_clave != null ) {
if ( entriesExist(" from claves where cod_clave=\'"+StringClip(true,request.cv_cod_clave)+"\'") == true ) {
redirect("alertpage.html?alert=2");
}
}
}
writeln('<FORM NAME="f_clave" METHOD="post"');
if (request.cv_cod_clave && !request.nvo )
htmlpath="o_clave.html?cv_cod_clave="+escape(request.cv_cod_clave)+"&"+baseHtml;
else
htmlpath="o_clave.html?nvo=1"+baseHtml;
writeln('action="'+htmlpath+'"');
writeln(' onSubmit="return Chek_fields(this)">');
LoadHidden(htmlpath);
if (!request.waux && request.FrameType == "L" )
ObjHeadBar(request.cv_cod_clave,"Claves","cv_");
writeln('<CENTER>');
writeln('<TABLE BORDER=1 ALIGN=CENTER><TR>');
writeln('<TR><TD ALIGN=RIGHT><B> Código Clave: </B></TD>');
if (request.cv_cod_clave && !request.nvo)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.cv_cod_clave+'</B></FONT><INPUT type="hidden" name="cv_cod_clave" VALUE="'+request.cv_cod_clave+'"></FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="cv_cod_clave" VALUE="'+request.cv_cod_clave+'" SIZE=3 OnChange="RePaint(this)"></TD></TR>');
writeln('<TR><TD ALIGN=RIGTH><B> Descripción: </B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.cv_descripcion+'</FONT></B><INPUT type="hidden" NAME="cv_descripcion" VALUE="'+request.cv_descripcion+'" SIZE=30 maxlength=30 ></FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="cv_descripcion" VALUE="'+request.cv_descripcion+'" SIZE=30 maxlength=30 ></TD></TR>');
writeln('</TABLE></FORM>');
if (!request.waux) {
writeSignature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

207
o_condpago.html Normal file
View File

@ -0,0 +1,207 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>cond_pago</TITLE>
<META NAME="GENERATOR" CONTENT="AdmiSys Sistemas informáticos">
<META NAME="Author" CONTENT="WebTeam">
<META NAME="Organization" CONTENT="AdmiSys S.L.">
<META NAME="Document description" CONTENT="Alta y Modificación de Condiciones de Pago">
<META NAME="Last modified date" CONTENT="Thursday, February 06, 1997 07:33:31">
</HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
function FormPaint(obj) {
document.f_condpago.action=top.main.document.location.href+"&cookie=1&lock=true";
document.f_condpago.submit();
}
function Chek_fields(obj) {
if ( emptyField(obj.cp_cond_pago) == true ) {
alert("!!! Es necesario rellenar el Código de Forma de Pago !!!->"+obj.cp_cond_pago.value+"<-");
return false;
}
return true;
}
</SCRIPT>
<SERVER>
var baseHtml="";
dbAcl();
writeln("<SCRIPT LANGUAGE='JavaScript'>");
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln('function RunFunction(obj,valor,clave,f_nro) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.f_condpago;');
writeln(' if ( obj == "Ayuda" ) {');
writeln(' NetHelp(valor);');
writeln(' }');
writeln(' history.back();');
writeln('}');
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
ObjButtons(request.cp_cond_pago,"Condiciones Pago","cp_");
}
writeln('}');
}
if ( request.ViewFkey == "S" ) {
writeln('function RePaint(obj) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' for ( var i=0; i < document.f_condpago.length; i++ ) { ');
writeln(' if ( document.f_condpago.elements[i].name == obj.name ) ');
writeln(' break; ');
writeln(' } ');
writeln(' document.f_condpago.action=mainFrame.document.location.href+"&cookie=1&nro="+i+"&lock=true"');
writeln(' document.f_condpago.submit();');
writeln('} ');
}
else {
writeln('function RePaint(obj) {');
writeln('} ');
}
writeln('function Enfoca(obj) {')
if ( request.nro ) {
writeln('document.f_condpago.elements['+request.nro+'].focus();');
}
writeln('}');
writeln("</SCRIPT>");
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\',\''+request.nvo+'\','+request.nro+')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln('<BODY "');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
if (request.gofunc) {
writeln(' </BODY>');
writeln(' </HTML>');
writeln(' <!--');
}
if (!request.cookie && !request.gofunc) {
dbConnect();
// Vemos que tarea hay que ejecutar:
if (request.add) {
if ( entriesExist(" from cond_pago where cond_pago=\'"+StringClip(true,request.cp_cond_pago)+"\'") == true ){
redirect("alertpage.html?alert=2");
}
else {
status=database.execute("INSERT INTO cond_pago(" +
" cond_pago," +
" descripcion," +
" vencimiento) VALUES ('" + StringClip(true,request.cp_cond_pago) + "','" +
StringClip(true,request.cp_descripcion) + "','"+
parseInt(request.cp_vencimiento) + "')");
if ( status != 0 )
redirect(addClient('error.html?alert=5'));
DbsError(true,status);
}
redirect(addClient("o_condpago.html?nvo=1&"+baseHtml));
}
//Ejecuta una actualización de la fila sobre la fila actual ...
if (request.upd && request.cp_cond_pago) {
// if (request.lock)
// c_cond_pago.close();
status=database.execute("UPDATE cond_pago SET "+
" descripcion='" + StringClip(true,request.cp_descripcion) + "',"+
" vencimiento='" + parseInt(request.cp_vencimiento) + "',"+
" cond_pago='" + StringClip(true,request.cp_cond_pago) + "'" +
" WHERE cond_pago = '" + request.cp_cond_pago + "'" );
if ( status != 0 )
redirect(addClient('error.html?alert=6'));
DbsError(true,status);
redirect(addClient("g_condpago.html?"+baseHtml));
}
//Ejecuta un borrado de la fila actual ...
if (request.del) {
status=database.execute("DELETE FROM cond_pago WHERE cond_pago = \'" + request.cp_cond_pago + "\'");
if ( status != 0 )
redirect(addClient('error.html?alert=7'));
DbsError(true,status);
redirect(addClient("g_condpago.html?"+baseHtml));
}
if (request.cp_cond_pago && !request.upd && !request.add ) {
// Si hay Clave de la tabla seleccionamos los datos ....
//Si se busca la fila ... usando la clave primaria de la relación
if (request.lock)
CursorTabla("cp","cond_pago","=\'"+request.cp_cond_pago+"\'",true,true);
else
CursorTabla("cp","cond_pago","=\'"+request.cp_cond_pago+"\'",true,"");
// Asignamos a request todas las columnas necesarias para el form.
request.cp_cond_pago=StringClip(false,c_cond_pago.cond_pago);
request.cp_descripcion=StringClip(false,c_cond_pago.descripcion);
request.cp_vencimiento=c_cond_pago.vencimiento+" ";
if (!request.lock)
c_cond_pago.close();
}
else {
// Estos son los Defaults Reales del Form ... Aquí pueden cambiarse ...
IniciaRequest("cp_");
request.lock=true;
}
}
else if (!request.gofunc) {
// Se entiende que request contiene todas las columnas necesarias para el form.
// y que esta llamada es para leer y cargar las claves foráneas de la tabla.
if (request.nvo && request.cp_cond_pago && request.cp_cond_pago != null ) {
if ( entriesExist(" from cond_pago where cond_pago=\'"+StringClip(true,request.cp_cond_pago)+"\'") == true ) {
redirect("alertpage.html?alert=2");
}
}
}
writeln('<FORM NAME="f_condpago" METHOD="post" ');
if (request.cp_cond_pago && !request.nvo )
htmlpath="o_condpago.html?cp_cond_pago="+escape(request.cp_cond_pago)+"&"+baseHtml;
else
htmlpath="o_condpago.html?nvo=1"+baseHtml;
writeln('action="'+htmlpath+'"');
writeln(' onSubmit="return Chek_fields(this)">');
LoadHidden(htmlpath);
if (!request.waux && request.FrameType == "L" )
ObjHeadBar(request.cp_cond_pago,"Condiciones Pago","cp_");
writeln(' <CENTER>');
writeln(' <TABLE BORDER=1 ALIGN=CENTER><TR>');
//if (!request.waux)
// writeln('<TD ALIGN=RIGHT><INPUT TYPE="button" VALUE=" N.I.F. " ONCLICK="w_auxiliar(\'cond_pago\',\'cond_pago\',\'cp_cond_pago\',\''+request.cp_cond_pago+'\')">');
//else {
//if (request.waux == 2)
// writeln('<TD></TD><TD align="right" valign="top"><A HREF="javascript:top.close()"><IMG SRC="images/exit1.gif" BORDER=0 HEIGHT=37 WIDTH=44></A></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B> Código: </B>');
//}
if (request.cp_cond_pago && !request.nvo)
writeln('<FONT COLOR="#800040"><B>'+request.cp_cond_pago+'</B></FONT><INPUT type="hidden" name="cp_cond_pago" VALUE="'+request.cp_cond_pago+'"></FONT></TD>');
else
writeln('<INPUT TYPE="text" NAME="cp_cond_pago" VALUE="'+request.cp_cond_pago+'" SIZE=2 OnChange="RePaint(this)"></TD>');
writeln('<TD ALIGN=RIGTH>');
if (request.waux || !request.lock)
writeln('<FONT COLOR="#800040"><B>'+request.cp_descripcion+'</FONT></B><INPUT type="hidden" NAME="cp_descripcion" VALUE="'+request.cp_descripcion+'" SIZE=40 maxlength=40 ></FONT></TD></TR>');
else
writeln('<INPUT TYPE="text" NAME="cp_descripcion" VALUE="'+request.cp_descripcion+'" SIZE=20 maxlength=20 ></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT> <B>Vencimiento:</B> ');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.cp_vencimiento+'<B></FONT></TD>');
else {
writeln('<TD> <INPUT TYPE="text" NAME="cp_vencimiento" VALUE="'+request.cp_vencimiento+'")');
writeln(' onFocus="setStatus(\'\')"');
writeln(' SIZE=3 </TD></TR>');
}
writeln('</TABLE></FORM>');
if (!request.waux) {
writeSignature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

212
o_ctascont.html Normal file
View File

@ -0,0 +1,212 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>cta_contable</TITLE>
<META NAME="GENERATOR" CONTENT="AdmiSys Sistemas informáticos">
<META NAME="Author" CONTENT="WebTeam">
<META NAME="Organization" CONTENT="AdmiSys S.L.">
<META NAME="Document description" CONTENT="Alta y Modificación de Cuentas Contables">
<META NAME="Last modified date" CONTENT="Thursday, February 06, 1997 07:33:31">
</HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
function FormPaint(obj) {
document.f_ctascont.action=top.main.document.location.href+"&cookie=1&lock=true";
document.f_ctascont.submit();
}
function Chek_fields(obj) {
if ( emptyField(obj.ct_cta_contable) == true ) {
alert("!!! Es necesario rellenar el Código de Cuentas a Contables !!!->"+obj.ct_cta_contable.value+"<-");
return false;
}
return true;
}
</SCRIPT>
<SERVER>
var baseHtml="";
dbAcl();
if ((!request.waux && request.lock) || request.nvo )
LoadParametros();
writeln("<SCRIPT LANGUAGE='JavaScript'>");
if ((!request.waux && request.lock) || request.nvo )
SetParametros();
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln('function RunFunction(obj,valor,clave,f_nro) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.f_ctascont;');
writeln(' if ( obj == "Ayuda" ) {');
writeln(' NetHelp(valor);');
writeln(' }');
writeln(' history.back();');
writeln('}');
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
ObjButtons(request.ct_cta_contable,"Cuentas Contables","ct_");
}
writeln('}');
}
if ( request.ViewFkey == "S" ) {
writeln('function RePaint(obj) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' for ( var i=0; i < document.f_ctascont.length; i++ ) { ');
writeln(' if ( document.f_centro.elements[i].name == obj.name ) ');
writeln(' break; ');
writeln(' } ');
writeln(' document.f_centro.action=top.main.document.location.href+"&cookie=1&nro="+i+"&lock=true"');
writeln(' document.f_centro.submit();');
writeln('} ');
}
else {
writeln('function RePaint(obj) {');
writeln('} ');
}
writeln('function Enfoca(obj) {')
if ( request.nro ) {
writeln('document.f_ctascont.elements['+request.nro+'].focus();');
}
writeln('}');
writeln("</SCRIPT>");
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\',\''+request.nvo+'\','+request.nro+')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln('<BODY "');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
if (request.gofunc) {
writeln(' </BODY>');
writeln(' </HTML>');
writeln(' <!--');
}
if (!request.cookie && !request.gofunc) {
dbConnect();
// Vemos que tarea hay que ejecutar:
if (request.add) {
if ( entriesExist(" from ctas_contables where cta_contable=\'"+StringClip(true,request.ct_cta_contable)+"\'") == true ){
redirect("alertpage.html?alert=2");
}
else {
status=database.execute("INSERT INTO ctas_contables (" +
" cta_contable," +
" descripcion," +
" es_nueva) VALUES ('" + StringClip(true,request.ct_cta_contable) + "','" +
StringClip(true,request.ct_descripcion) + "','"+
StringClip(true,request.ct_es_nueva) + "')");
if ( status != 0 )
redirect(addClient('error.html?alert=5'));
DbsError(true,status);
}
redirect(addClient("o_ctascont.html?nvo=1&"+baseHtml));
}
//Ejecuta una actualización de la fila sobre la fila actual ...
if (request.upd && request.ct_cta_contable) {
// if (request.lock)
// c_ctas_contables.close();
status=database.execute("UPDATE ctas_contables SET "+
" descripcion='" + StringClip(true,request.ct_descripcion) + "',"+
" es_nueva='" + StringClip(true,request.ct_es_nueva) + "'"+
" WHERE cta_contable = '" + request.ct_cta_contable + "'" );
if ( status != 0 )
redirect(addClient('error.html?alert=6'));
DbsError(true,status);
redirect(addClient("g_ctascont.html?"+baseHtml));
}
//Ejecuta un borrado de la fila actual ...
if (request.del) {
status=database.execute("DELETE FROM ctas_contables WHERE cta_contable = \'" + request.ct_cta_contable + "\'");
if ( status != 0 )
redirect(addClient('error.html?alert=7'));
DbsError(true,status);
redirect(addClient("g_ctascont.html?"+baseHtml));
}
if (request.ct_cta_contable && !request.upd && !request.add ) {
// Si hay Clave de la tabla seleccionamos los datos ....
//Si se busca la fila ... usando la clave primaria de la relación
if (request.lock)
CursorTabla("ct","cta_contable","=\'"+request.ct_cta_contable+"\'",true,true);
else
CursorTabla("ct","cta_contable","=\'"+request.ct_cta_contable+"\'",true,"");
// Asignamos a request todas las columnas necesarias para el form.
request.ct_cta_contable=StringClip(false,c_ctas_contables.cta_contable);
request.ct_descripcion=StringClip(false,c_ctas_contables.descripcion);
request.ct_es_nueva=StringClip(false,c_ctas_contables.es_nueva);
if (!request.lock)
c_ctas_contables.close();
}
else {
// Estos son los Defaults Reales del Form ... Aquí pueden cambiarse ...
IniciaRequest("ct_");
request.lock=true;
}
}
else if (!request.gofunc) {
// Se entiende que request contiene todas las columnas necesarias para el form.
// y que esta llamada es para leer y cargar las claves foráneas de la tabla.
if (request.nvo && request.ct_cta_contable && request.ct_cta_contable != null ) {
if ( entriesExist(" from ctas_contables where cta_contable=\'"+StringClip(true,request.ct_cta_contable)+"\'") == true ) {
redirect("alertpage.html?alert=2");
}
}
}
writeln('<FORM NAME="f_ctascont" METHOD="post"');
if (request.ct_cta_contable && !request.nvo )
htmlpath="o_ctascont.html?ct_cta_contable="+escape(request.ct_cta_contable)+"&"+baseHtml;
else
htmlpath="o_ctascont.html?nvo=1"+baseHtml;
writeln('action="'+htmlpath+'"');
writeln(' onSubmit="return Chek_fields(this)">');
LoadHidden(htmlpath);
if (!request.waux && request.FrameType == "L" )
ObjHeadBar(request.ct_cta_contable,"Cuentas Contables","ct_");
writeln(' <CENTER>');
writeln(' <TABLE BORDER=1 ALIGN=CENTER><TR>');
//if (!request.waux)
// writeln('<TD ALIGN=RIGHT><INPUT TYPE="button" VALUE=" N.I.F. " ONCLICK="w_auxiliar(\'cta_contable\',\'cta_contable\',\'ct_cta_contable\',\''+request.ct_cta_contable+'\')">');
//else {
//if (request.waux == 2)
// writeln('<TD></TD><TD align="right" valign="top"><A HREF="javascript:top.close()"><IMG SRC="images/exit1.gif" BORDER=0 HEIGHT=37 WIDTH=44></A></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B> Código Cuenta: </B></TD>');
//}
if (request.ct_cta_contable && !request.nvo)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.ct_cta_contable+'</B></FONT><INPUT type="hidden" name="ct_cta_contable" VALUE="'+request.ct_cta_contable+'" OnChange="CtaNroPad(this)"></FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="ct_cta_contable" VALUE="'+request.ct_cta_contable+'" SIZE='+client.pa_longcta+' OnChange="CtaNroPad(this);RePaint(this)"></TD></TR>');
writeln('<TR><TD ALIGN=RIGTH><B> Descripción: </B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.ct_descripcion+'</FONT></B><INPUT type="hidden" NAME="ct_descripcion" VALUE="'+request.ct_descripcion+'" SIZE=40 maxlength=40 ></FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="ct_descripcion" VALUE="'+request.ct_descripcion+'" SIZE=40 maxlength=40 ></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT> <B>Es Nueva Cuenta:</B></TD> ');
if (request.waux || !request.lock)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.ct_es_nueva+'<B></FONT></TD><INPUT type="hidden" NAME="ct_es_nueva" VALUE="'+request.ct_es_nueva+'" SIZE=1 ></FONT></TD></TR>');
else {
writeln('<TD ALIGN=RIGTH><SELECT name="ct_es_nueva" size=2>');
if (request.ct_es_nueva == "S")
writeln('<OPTION value="S" selected>Si&nbsp;<OPTION value="N">No&nbsp;');
else
writeln('<OPTION value="S">Si&nbsp;<OPTION value="N" selected>No&nbsp;');
writeln('</SELECT></TD>');
}
writeln('</TABLE></FORM>');
if (!request.waux) {
writeSignature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

2034
o_factura.html Normal file

File diff suppressed because it is too large Load Diff

186
o_localidad.html Normal file
View File

@ -0,0 +1,186 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>cod_localidad</TITLE>
<META NAME="GENERATOR" CONTENT="AdmiSys Sistemas informáticos">
<META NAME="Author" CONTENT="WebTeam">
<META NAME="Organization" CONTENT="AdmiSys S.L.">
<META NAME="Document description" CONTENT="Alta y Modificación de localidades Contables">
<META NAME="Last modified date" CONTENT="Thursday, February 06, 1997 07:33:31">
</HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
function FormPaint(obj) {
document.f_localidad.action=top.main.document.location.href+"&cookie=1&lock=true";
document.f_localidad.submit();
}
function Chek_fields(obj) {
if ( emptyField(obj.lo_cod_localidad) == true ) {
alert("!!! Es necesario rellenar el Código de localidad !!!->"+obj.lo_cod_localidad.value+"<-");
return false;
}
return true;
}
</SCRIPT>
<SERVER>
var baseHtml="";
dbAcl();
writeln("<SCRIPT LANGUAGE='JavaScript'>");
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln('function RunFunction(obj,valor,localidad,f_nro) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.f_localidad;');
writeln(' if ( obj == "Ayuda" ) {');
writeln(' NetHelp(valor);');
writeln(' }');
writeln(' history.back();');
writeln('}');
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
ObjButtons(request.lo_cod_localidad,"localidades","lo_");
}
writeln('}');
}
if ( request.ViewFkey == "S" ) {
writeln('function RePaint(obj) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' for ( var i=0; i < document.f_localidad.length; i++ ) { ');
writeln(' if ( document.f_localidad.elements[i].name == obj.name ) ');
writeln(' break; ');
writeln(' } ');
writeln(' document.f_localidad.action=mainFrame.document.location.href+"&cookie=1&nro="+i+"&lock=true"');
writeln(' document.f_localidad.submit();');
writeln('} ');
}
else {
writeln('function RePaint(obj) {');
writeln('} ');
}
writeln('function Enfoca(obj) {')
if ( request.nro ) {
writeln('document.f_localidad.elements['+request.nro+'].focus();');
}
writeln('}');
writeln("</SCRIPT>");
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\',\''+request.nvo+'\','+request.nro+')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln(' <BODY');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
if (request.gofunc) {
writeln(' </BODY>');
writeln(' </HTML>');
writeln(' <!--');
}
if (!request.cookie && !request.gofunc) {
dbConnect();
// Vemos que tarea hay que ejecutar:
if (request.add) {
if ( entriesExist(" from localidades where cod_localidad=\'"+StringClip(true,request.lo_cod_localidad)+"\'") == true ){
redirect("alertpage.html?alert=2");
}
else {
status=database.execute("INSERT INTO localidades (" +
" cod_localidad," +
" descripcion ) VALUES ('" + StringClip(true,request.lo_cod_localidad) + "','" +
StringClip(true,request.lo_descripcion) + "')");
if ( status != 0 )
redirect(addClient('error.html?alert=5'));
DbsError(true,status);
}
redirect(addClient("o_localidad.html?nvo=1&"+baseHtml));
}
//Ejecuta una actualización de la fila sobre la fila actual ...
if (request.upd && request.lo_cod_localidad) {
// if (request.lock)
// c_localidades.close();
status=database.execute("UPDATE localidades SET "+
" descripcion='" + StringClip(true,request.lo_descripcion) + "'"+
" WHERE cod_localidad = '" + request.lo_cod_localidad + "'" );
if ( status != 0 )
redirect(addClient('error.html?alert=6'));
DbsError(true,status);
redirect(addClient("g_localidad.html?"+baseHtml));
}
//Ejecuta un borrado de la fila actual ...
if (request.del) {
status=database.execute("DELETE FROM localidades WHERE cod_localidad = \'" + request.lo_cod_localidad + "\'");
if ( status != 0 )
redirect(addClient('error.html?alert=7'));
DbsError(true,status);
redirect(addClient("g_localidad.html?"+baseHtml));
}
if (request.lo_cod_localidad && !request.upd && !request.add ) {
// Si hay localidad de la tabla seleccionamos los datos ....
//Si se busca la fila ... usando la localidad primaria de la relación
if (request.lock)
CursorTabla("lo","cod_localidad","=\'"+request.lo_cod_localidad+"\'",true,true);
else
CursorTabla("lo","cod_localidad","=\'"+request.lo_cod_localidad+"\'",true,"");
// Asignamos a request todas las columnas necesarias para el form.
request.lo_cod_localidad=StringClip(false,c_localidades.cod_localidad);
request.lo_descripcion=StringClip(false,c_localidades.descripcion);
if (!request.lock)
c_localidades.close();
}
else {
// Estos son los Defaults Reales del Form ... Aquí pueden cambiarse ...
IniciaRequest("lo_");
request.lock=true;
}
}
else if (!request.gofunc) {
// Se entiende que request contiene todas las columnas necesarias para el form.
// y que esta llamada es para leer y cargar las localidades foráneas de la tabla.
if (request.nvo && request.lo_cod_localidad && request.lo_cod_localidad != null ) {
if ( entriesExist(" from localidades where cod_localidad=\'"+StringClip(true,request.lo_cod_localidad)+"\'") == true ) {
redirect("alertpage.html?alert=2");
}
}
}
writeln('<FORM NAME="f_localidad" METHOD="post"');
if (request.lo_cod_localidad && !request.nvo )
htmlpath="o_localidad.html?lo_cod_localidad="+escape(request.lo_cod_localidad)+"&"+baseHtml;
else
htmlpath="o_localidad.html?nvo=1"+baseHtml;
writeln('action="'+htmlpath+'"');
writeln(' onSubmit="return Chek_fields(this)">');
LoadHidden(htmlpath);
if (!request.waux && request.FrameType == "L" )
ObjHeadBar(request.lo_cod_localidad,"localidades","lo_");
writeln('<CENTER>');
writeln('<TABLE BORDER=1 ALIGN=CENTER><TR>');
writeln('<TR><TD ALIGN=RIGHT><B> Código localidad: </B></TD>');
if (request.lo_cod_localidad && !request.nvo)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.lo_cod_localidad+'</B></FONT><INPUT type="hidden" name="lo_cod_localidad" VALUE="'+request.lo_cod_localidad+'"></FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="lo_cod_localidad" VALUE="'+request.lo_cod_localidad+'" SIZE=3 OnChange="RePaint(this)"></TD></TR>');
writeln('<TR><TD ALIGN=RIGTH><B> Descripción: </B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.lo_descripcion+'</FONT></B><INPUT type="hidden" NAME="lo_descripcion" VALUE="'+request.lo_descripcion+'" SIZE=30 maxlength=30 ></FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="lo_descripcion" VALUE="'+request.lo_descripcion+'" SIZE=30 maxlength=30 ></TD></TR>');
writeln('</TABLE></FORM>');
if (!request.waux) {
writeSignature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

473
o_parame.html Normal file
View File

@ -0,0 +1,473 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>id</TITLE>
<META NAME="GENERATOR" CONTENT="AdmiSys Sistemas informáticos">
<META NAME="Author" CONTENT="WebTeam">
<META NAME="Organization" CONTENT="AdmiSys S.L.">
<META NAME="Document description" CONTENT="Alta y Modificación de Parámetors">
<META NAME="Last modified date" CONTENT="Thursday, February 06, 1997 07:33:31">
</HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
function FormPaint(obj) {
document.f_parametros.action=top.main.document.location.href+"&cookie=1&lock=true";
document.f_parametros.submit();
}
function Chek_fields(obj) {
if ( emptyField(obj.pa_id) == true ) {
alert("!!! Es necesario rellenar el Código de parametros a Contables !!!->"+obj.pa_id.value+"<-");
return false;
}
return true;
}
function Check_dia_1(obj) {
var mainFrame=find_frame(top,"main");
var f_frame=mainFrame.document.f_parametros;
nro=parseInt(obj.value);
if (nro <1 || nro > 31 ) {
alert("¡¡¡ Nro. de día debe estar entre 1 y 31 !!!")
obj.focus();
}
if (nro > parseInt(f_frame.pa_dia_pago_2.value)) {
alert("¡¡¡ Nro. de día pago 1 no puede ser mayor que el día pago 2 !!!")
obj.focus();
}
}
function Check_dia_2(obj) {
var mainFrame=find_frame(top,"main");
var f_frame=mainFrame.document.f_parametros;
nro=parseInt(obj.value);
if (nro <1 || nro > 31 ) {
alert("¡¡¡ Nro. de día debe estar entre 1 y 31 !!!")
obj.focus();
}
if (nro < parseInt(f_frame.pa_dia_pago_1.value)) {
alert("¡¡¡ Nro. de día pago 2 no puede ser menor que el día pago 1 !!!")
obj.focus();
}
}
</SCRIPT>
<SERVER>
// Variables para el Server
var HOY=new Date();
var entorno = new entObj(0);
// Algunos formatos para fechas.
var NLDF=""; // para columnas en las queries INFORMIX
var IFDF=""; // para columnas en SQL según DBDATE
var baseHtml="";
dbAcl();
if ((!request.waux && request.lock) || request.nvo )
LoadParametros();
writeln("<SCRIPT LANGUAGE='JavaScript'>");
if ((!request.waux && request.lock) || request.nvo )
SetParametros();
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln('function RunFunction(obj,valor,parametros,f_nro) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.f_parametros;');
writeln(' if ( obj == "Ayuda" ) {');
writeln(' NetHelp(valor);');
writeln(' }');
writeln(' history.back();');
writeln('}');
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
ObjButtons(request.pa_id,"parametros","pa_");
}
writeln('}');
}
if ( request.ViewFkey == "S" ) {
writeln('function RePaint(obj) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' for ( var i=0; i < document.f_parametros.length; i++ ) { ');
writeln(' if ( document.f_parametros.elements[i].name == obj.name ) ');
writeln(' break; ');
writeln(' } ');
writeln(' document.f_parametros.action=mainFrame.document.location.href+"&cookie=1&nro="+i+"&lock=true"');
writeln(' document.f_parametros.submit();');
writeln('} ');
}
else {
writeln('function RePaint(obj) {');
writeln('} ');
}
writeln('function Enfoca(obj) {')
if ( request.nro ) {
writeln('document.f_parametros.elements['+request.nro+'].focus();');
}
writeln('}');
writeln("</SCRIPT>");
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\',\''+request.nvo+'\','+request.nro+')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln(' <BODY');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
if (request.gofunc) {
writeln(' </BODY>');
writeln(' </HTML>');
writeln(' <!--');
}
if (!request.cookie && !request.gofunc) {
dbConnect();
// Vemos que tarea hay que ejecutar:
if (request.add) {
if ( entriesExist(" from parametros where id=\'"+StringClip(true,request.pa_id)+"\'") == true ){
redirect("alertpage.html?alert=2");
}
else {
status=database.execute("INSERT INTO parametros (" +
" nro_reg," +
" ultimo_actual," +
" nro_remesa," +
" iva_1," +
" iva_2," +
" iva_3," +
" reten_1," +
" cta_reten_1," +
" clave_reten_1," +
" reten_2," +
" cta_reten_2," +
" clave_reten_2," +
" dia_pago_1," +
" dia_pago_2," +
" ex_dia_pago," +
" longcta," +
" cta_iva," +
" clave_iva," +
" cta_cont," +
" clave_cont," +
" cta_comp," +
" clave_comp," +
" cta_coniva," +
" clave_coniva," +
" cta_siniva," +
" clave_siniva," +
" cta_dev," +
" clave_dev,"+
" cp_lock ) VALUES ('" +
StringClip(true,request.pa_nro_reg) + "','" +
DateFormat(request.pa_ultimo_actual,NLDF) + "','"+
StringClip(true,request.pa_nro_remesa) + "','" +
request.pa_iva_1 + "','" +
request.pa_iva_2 + "','" +
request.pa_iva_3 + "','" +
request.pa_reten_1 + "','" +
StringClip(true,request.pa_cta_reten_1) + "','" +
StringClip(true,request.pa_clave_reten_1) + "','" +
request.pa_reten_2 + "','" +
StringClip(true,request.pa_cta_reten_2) + "','" +
StringClip(true,request.pa_clave_reten_2) + "','" +
request.pa_dia_pago_1 + "','" +
request.pa_dia_pago_2 + "','" +
StringClip(true,request.pa_ex_dia_pago) + "','" +
request.pa_longcta + "','" +
StringClip(true,request.pa_cta_iva) + "','" +
StringClip(true,request.pa_clave_iva) + "','" +
StringClip(true,request.pa_cta_cont) + "','" +
StringClip(true,request.pa_clave_cont) + "','" +
StringClip(true,request.pa_cta_comp) + "','" +
StringClip(true,request.pa_clave_comp) + "','" +
StringClip(true,request.pa_cta_coniva) + "','" +
StringClip(true,request.pa_clave_coniva) + "','" +
StringClip(true,request.pa_cta_siniva) + "','" +
StringClip(true,request.pa_clave_siniva) + "','" +
StringClip(true,request.pa_cta_dev) + "','" +
StringClip(true,request.pa_clave_dev) + "','" +
StringClip(true,request.pa_cp_lock) + "')");
if ( status != 0 )
redirect(addClient('error.html?alert=5'));
DbsError(true,status);
}
redirect(addClient("o_parame.html?pa_id=1&"+baseHtml));
}
//Ejecuta una actualización de la fila sobre la fila actual ...
if (request.upd && request.pa_id) {
// if (request.lock)
// c_parametros.close();
status=database.execute("UPDATE parametros SET "+
" nro_reg='" + StringClip(true,request.pa_nro_reg) + "',"+
" ultimo_actual='" + DateFormat(request.pa_ultimo_actual,NLDF) + "',"+
" nro_remesa='" + StringClip(true,request.pa_nro_remesa) + "',"+
" iva_1='" + request.pa_iva_1 + "',"+
" iva_2='" + request.pa_iva_2 + "',"+
" iva_3='" + request.pa_iva_3 + "',"+
" reten_1='" + request.pa_reten_1 + "',"+
" cta_reten_1='" + StringClip(true,request.pa_cta_reten_1) + "',"+
" clave_reten_1='" + StringClip(true,request.pa_clave_reten_1) + "',"+
" reten_2='" + request.pa_reten_2 + "',"+
" cta_reten_2='" + StringClip(true,request.pa_cta_reten_2) + "',"+
" clave_reten_2='" + StringClip(true,request.pa_clave_reten_2) + "',"+
" dia_pago_1='" + request.pa_dia_pago_1 + "',"+
" dia_pago_2='" + request.pa_dia_pago_2 + "',"+
" ex_dia_pago='" + StringClip(true,request.pa_ex_dia_pago) + "',"+
" longcta='" + request.pa_longcta + "',"+
" cta_iva='" + StringClip(true,request.pa_cta_iva) + "',"+
" clave_iva='" + StringClip(true,request.pa_clave_iva) + "',"+
" cta_cont='" + StringClip(true,request.pa_cta_cont) + "',"+
" clave_cont='" + StringClip(true,request.pa_clave_cont) + "',"+
" cta_comp='" + StringClip(true,request.pa_cta_comp) + "',"+
" clave_comp='" + StringClip(true,request.pa_clave_comp) + "',"+
" cta_coniva='" + StringClip(true,request.pa_cta_coniva) + "',"+
" clave_coniva='" + StringClip(true,request.pa_clave_coniva) + "',"+
" cta_siniva='" + StringClip(true,request.pa_cta_siniva) + "',"+
" clave_siniva='" + request.pa_clave_siniva + "',"+
" cta_dev='" + request.pa_cta_dev + "',"+
" clave_dev='" + request.pa_clave_dev + "',"+
" cp_lock='" + request.pa_cp_lock + "'"+
" WHERE id = '" + request.pa_id + "'" );
if ( status != 0 )
redirect(addClient('error.html?alert=6'));
DbsError(true,status);
redirect(addClient("o_parame.html?pa_id=1&"+baseHtml));
}
//Ejecuta un borrado de la fila actual ...
if (request.del) {
// status=database.execute("DELETE FROM parametros WHERE id = \'" + request.pa_id + "\'");
// if ( status != 0 )
// redirect(addClient('error.html?alert=7'));
//
// DbsError(true,status);
redirect(addClient("o_parame.html?pa_id=1&"+baseHtml));
}
if (request.pa_id && !request.upd && !request.add ) {
// Si hay parametros de la tabla seleccionamos los datos ....
//Si se busca la fila ... usando la parametros primaria de la relación
if (request.lock)
CursorTabla("pa","id","=\'"+request.pa_id+"\'",true,true);
else
CursorTabla("pa","id","=\'"+request.pa_id+"\'",true,"");
// Asignamos a request todas las columnas necesarias para el form.
request.pa_ultimo_actual=datetoString(c_parametros.ultimo_actual);
request.pa_nro_reg = StringClip(false,c_parametros.nro_reg);
request.pa_nro_remesa = StringClip(false,c_parametros.nro_remesa);
request.pa_longcta = c_parametros.longcta;
request.pa_dia_pago_1 = c_parametros.dia_pago_1;
request.pa_dia_pago_2 = c_parametros.dia_pago_2;
request.pa_ex_dia_pago = c_parametros.ex_dia_pago;
request.pa_iva_1 = c_parametros.iva_1;
request.pa_iva_2 = c_parametros.iva_2;
request.pa_iva_3 = c_parametros.iva_3;
request.pa_reten_1 = c_parametros.reten_1;
request.pa_cta_reten_1 = StringClip(false,c_parametros.cta_reten_1);
request.pa_clave_reten_1 = StringClip(false,c_parametros.clave_reten_1);
request.pa_reten_2 = c_parametros.reten_2;
request.pa_cta_reten_2 = StringClip(false,c_parametros.cta_reten_2);
request.pa_clave_reten_2 = StringClip(false,c_parametros.clave_reten_2);
request.pa_cta_iva = StringClip(false,c_parametros.cta_iva);
request.pa_clave_iva = StringClip(false,c_parametros.clave_iva);
request.pa_cta_cont = StringClip(false,c_parametros.cta_cont);
request.pa_clave_cont = StringClip(false,c_parametros.clave_cont);
request.pa_cta_comp = StringClip(false,c_parametros.cta_comp);
request.pa_clave_comp = StringClip(false,c_parametros.clave_comp);
request.pa_cta_coniva = StringClip(false,c_parametros.cta_coniva);
request.pa_clave_coniva = StringClip(false,c_parametros.clave_coniva);
request.pa_cta_siniva = StringClip(false,c_parametros.cta_siniva);
request.pa_clave_siniva = StringClip(false,c_parametros.clave_siniva);
request.pa_cta_dev = StringClip(false,c_parametros.cta_dev);
request.pa_clave_dev = StringClip(false,c_parametros.clave_dev);
request.pa_cp_lock = StringClip(false,c_parametros.cp_lock);
if (!request.lock)
c_parametros.close();
}
else {
// Estos son los Defaults Reales del Form ... Aquí pueden cambiarse ...
IniciaRequest("pa_");
request.lock=true;
}
}
else if (!request.gofunc) {
// Se entiende que request contiene todas las columnas necesarias para el form.
// y que esta llamada es para leer y cargar las parametros foráneas de la tabla.
if (request.nvo && request.pa_id && request.pa_id != null ) {
if ( entriesExist(" from parametros where id=\'"+StringClip(true,request.pa_id)+"\'") == true ) {
redirect("alertpage.html?alert=2");
}
}
}
writeln('<FORM NAME="f_parametros" METHOD="post"');
if (request.pa_id && !request.nvo )
htmlpath="o_parame.html?pa_id="+request.pa_id+"&"+baseHtml;
else
htmlpath="o_parame.html?nvo=1"+baseHtml;
writeln('action="'+htmlpath+'"');
writeln(' onSubmit="return Chek_fields(this)">');
LoadHidden(htmlpath);
if (!request.waux && request.FrameType == "L" )
ObjHeadBar(request.pa_id,"parametros","pa_");
writeln('<CENTER>');
writeln('<TABLE BORDER=1 ALIGN=CENTER><TR>');
//if (request.waux == 2)
// writeln('<TD></TD><TD align="right" valign="top"><A HREF="javascript:top.close()"><IMG SRC="images/exit1.gif" BORDER=0 HEIGHT=37 WIDTH=44></A></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B> Código parametros: </B></TD>');
//}
if (request.pa_id && !request.nvo)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_id+'</B></FONT><INPUT type="hidden" name="pa_id" VALUE="'+request.pa_id+'"></FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_id" VALUE="'+request.pa_id+'" SIZE=3 OnChange="RePaint(this)"></TD></TR>');
writeln('<TR><TD ALIGN=RIGTH><B> Nro.Registro Facturas: </B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_nro_reg+'</FONT></B><INPUT type="hidden" NAME="pa_nro_reg" VALUE="'+request.pa_nro_reg+'" SIZE=10 maxlength=10 ></FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_nro_reg" VALUE="'+request.pa_nro_reg+'" SIZE=10 maxlength=10 ></TD></TR>');
writeln('<TR><TD ALIGN=RIGTH><B> Fecha Ult.Modificación: </B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_ultimo_actual+'</FONT></B><INPUT type="hidden" NAME="pa_ultimo_actual" VALUE="'+request.pa_ultimo_actual+'" SIZE=10 maxlength=10 ></FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_ultimo_actual" VALUE="'+request.pa_ultimo_actual+'" onBlur="ToStringDate(this,IFDF)" onFocus="UnfrmtStrDate(this,IFDF)" SIZE=10 maxlength=10 ></TD></TR>');
writeln('<TR><TD ALIGN=RIGTH><B> Nro.Remesa Vtos.: </B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_nro_remesa+'</FONT></B><INPUT type="hidden" NAME="pa_nro_remesa" VALUE="'+request.pa_nro_remesa+'" SIZE=10 maxlength=10 ></FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_nro_remesa" VALUE="'+request.pa_nro_remesa+'" SIZE=10 maxlength=10 ></TD></TR>');
writeln('<TR><TD ALIGN=RIGTH><B> % I.V.A. Tipo Uno: </B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_iva_1+'</FONT></B><INPUT type="hidden" NAME="pa_iva_1" VALUE="'+request.pa_iva_1+'" SIZE=2 maxlength=2 >%</FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_iva_1" VALUE="'+request.pa_iva_1+'" OnChange="isNroThis(this)" SIZE=2 maxlength=2 >%</TD></TR>');
writeln('<TR><TD ALIGN=RIGTH><B> % I.V.A. Tipo Dos: </B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_iva_2+'</FONT></B><INPUT type="hidden" NAME="pa_iva_2" VALUE="'+request.pa_iva_2+'" SIZE=2 maxlength=2 >%</FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_iva_2" VALUE="'+request.pa_iva_2+'" OnChange="isNroThis(this)" SIZE=2 maxlength=2 >%</TD></TR>');
writeln('<TR><TD ALIGN=RIGTH><B> % I.V.A. Tipo Tres: </B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_iva_3+'</FONT></B><INPUT type="hidden" NAME="pa_iva_3" VALUE="'+request.pa_iva_3+'" SIZE=2 maxlength=2 >%</FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_iva_3" VALUE="'+request.pa_iva_3+'" OnChange="isNroThis(this)" SIZE=2 maxlength=2 >%</TD></TR>');
writeln('<TR><TD ALIGN=RIGTH><B> % I.R.P.F.: </B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_reten_1+'</FONT></B><INPUT type="hidden" NAME="pa_reten_1" VALUE="'+request.pa_reten_1+'" SIZE=2 maxlength=2 >%</FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_reten_1" VALUE="'+request.pa_reten_1+'" OnChange="isNroThis(this)" SIZE=2 maxlength=2 >%</TD></TR>');
writeln('<TR><TD ALIGN=RIGTH><B> Cta. para Retenciones I.R.P.F.: </B></TD>');
if (request.waux || !request.lock) {
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_cta_reten_1+'</FONT></B><INPUT type="hidden" NAME="pa_cta_reten_1" VALUE="'+request.pa_cta_reten_1+'" SIZE=12 maxlength=12 ></FONT></TD>');
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_clave_reten_1+'</FONT></B><INPUT type="hidden" NAME="pa_clave_reten_1" VALUE="'+request.pa_clave_reten_1+'" SIZE=3 maxlength=3 ></FONT></TD></TR>');
}
else {
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_cta_reten_1" VALUE="'+request.pa_cta_reten_1+'" OnChange="CtaNroPad(this);//RePaint(this)" SIZE=12 maxlength=12 ></TD>');
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_clave_reten_1" VALUE="'+request.pa_clave_reten_1+'" SIZE=3 maxlength=3 ></TD></TR>');
}
writeln('<TR><TD ALIGN=RIGTH><B> % Garantía: </B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_reten_2+'</FONT></B><INPUT type="hidden" NAME="pa_reten_2" VALUE="'+request.pa_por_reten+'" SIZE=2 maxlength=2 >%</FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_reten_2" VALUE="'+request.pa_reten_2+'" OnChange="isNroThis(this)" SIZE=2 maxlength=2 >%</TD></TR>');
writeln('<TR><TD ALIGN=RIGTH><B> Cta. para Garantía: </B></TD>');
if (request.waux || !request.lock) {
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_cta_reten_2+'</FONT></B><INPUT type="hidden" NAME="pa_cta_reten_2" VALUE="'+request.pa_cta_reten_2+'" SIZE=12 maxlength=12 ></FONT></TD>');
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_clave_reten_2+'</FONT></B><INPUT type="hidden" NAME="pa_clave_reten_2" VALUE="'+request.pa_clave_reten_2+'" SIZE=3 maxlength=3 ></FONT></TD></TR>');
}
else {
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_cta_reten_2" VALUE="'+request.pa_cta_reten_2+'" OnChange="CtaNroPad(this);//RePaint(this)" SIZE=12 maxlength=12 ></TD>');
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_clave_reten_2" VALUE="'+request.pa_clave_reten_2+'" SIZE=3 maxlength=3 ></TD></TR>');
}
writeln('<TR><TD ALIGN=RIGTH><B> Nro. Día de Pago Uno del Mes: </B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_dia_pago_1+'</FONT></B><INPUT type="hidden" NAME="pa_dia_pago_1" VALUE="'+request.pa_dia_pago_1+'" SIZE=2 maxlength=2 ></FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_dia_pago_1" VALUE="'+request.pa_dia_pago_1+'" OnChange="Check_dia_1(this)" SIZE=2 maxlength=2 ></TD></TR>');
writeln('<TR><TD ALIGN=RIGTH><B> Nro. Día de Pago Dos del Mes: </B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_dia_pago_2+'</FONT></B><INPUT type="hidden" NAME="pa_dia_pago_2" VALUE="'+request.pa_dia_pago_2+'" SIZE=2 maxlength=2 ></FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_dia_pago_2" VALUE="'+request.pa_dia_pago_2+'" OnChange="Check_dia_2(this)" SIZE=2 maxlength=2 ></TD></TR>');
writeln('<TR><TD ALIGN=RIGTH><B> Días a excluir de Pago: </B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_ex_dia_pago+'</FONT></B><INPUT type="hidden" NAME="pa_ex_dia_pago" VALUE="'+request.pa_ex_dia_pago+'" SIZE=12 maxlength=12 ></FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_ex_dia_pago" VALUE="'+request.pa_ex_dia_pago+'" SIZE=12 maxlength=12 ></TD></TR>');
writeln('<TR><TD ALIGN=RIGTH><B> Longitud de Cuentas Plan Contable: </B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_longcta+'</FONT></B><INPUT type="hidden" NAME="pa_longcta" VALUE="'+request.pa_longcta+'" SIZE=2 maxlength=2 ></FONT></TD></TR>');
else
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_longcta" VALUE="'+request.pa_longcta+'" SIZE=2 maxlength=2 ></TD></TR>');
writeln('<TR><TD ALIGN=RIGTH><B> Cta. Contable Empieza por: </B></TD>');
if (request.waux || !request.lock) {
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_cta_cont+'</FONT></B><INPUT type="hidden" NAME="pa_cta_cont" VALUE="'+request.pa_cta_cont+'" SIZE=12 maxlength=12 ></FONT></TD>');
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_clave_cont+'</FONT></B><INPUT type="hidden" NAME="pa_clave_cont" VALUE="'+request.pa_clave_cont+'" SIZE=3 maxlength=3 ></FONT></TD></TR>');
}
else {
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_cta_cont" VALUE="'+request.pa_cta_cont+'" OnChange="isNroThis(this);//RePaint(this)" SIZE=12 maxlength=12 ></TD>');
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_clave_cont" VALUE="'+request.pa_clave_cont+'" SIZE=3 maxlength=3 ></TD></TR>');
}
writeln('<TR><TD ALIGN=RIGTH><B> Cuenta de I.V.A. : </B></TD>');
if (request.waux || !request.lock) {
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_cta_iva+'</FONT></B><INPUT type="hidden" NAME="pa_cta_iva" VALUE="'+request.pa_cta_iva+'" SIZE=12 maxlength=12 ></FONT></TD>');
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_clave_iva+'</FONT></B><INPUT type="hidden" NAME="pa_clave_iva" VALUE="'+request.pa_clave_iva+'" SIZE=3 maxlength=3 ></FONT></TD></TR>');
}
else {
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_cta_iva" VALUE="'+request.pa_cta_iva+'" OnChange="CtaNroPad(this);//RePaint(this)" SIZE=12 maxlength=12 ></TD>');
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_clave_iva" VALUE="'+request.pa_clave_iva+'" SIZE=3 maxlength=3 ></TD></TR>');
}
writeln('<TR><TD ALIGN=RIGTH><B> Cta. para Gastos de Compensación: </B></TD>');
if (request.waux || !request.lock) {
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_cta_comp+'</FONT></B><INPUT type="hidden" NAME="pa_cta_comp" VALUE="'+request.pa_cta_comp+'" SIZE=12 maxlength=12 ></FONT></TD>');
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_clave_comp+'</FONT></B><INPUT type="hidden" NAME="pa_clave_comp" VALUE="'+request.pa_clave_comp+'" SIZE=3 maxlength=3 ></FONT></TD></TR>');
}
else {
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_cta_comp" VALUE="'+request.pa_cta_comp+'" OnChange="CtaNroPad(this);//RePaint(this)" SIZE=12 maxlength=12 ></TD>');
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_clave_comp" VALUE="'+request.pa_clave_comp+'" SIZE=3 maxlength=3 ></TD></TR>');
}
writeln('<TR><TD ALIGN=RIGTH><B> Cta. para Gastos con I.V.A.: </B></TD>');
if (request.waux || !request.lock) {
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_cta_coniva+'</FONT></B><INPUT type="hidden" NAME="pa_cta_coniva" VALUE="'+request.pa_cta_coniva+'" SIZE=12 maxlength=12 ></FONT></TD>');
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_clave_coniva+'</FONT></B><INPUT type="hidden" NAME="pa_clave_coniva" VALUE="'+request.pa_clave_coniva+'" SIZE=3 maxlength=3 ></FONT></TD></TR>');
}
else {
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_cta_coniva" VALUE="'+request.pa_cta_coniva+'" OnChange="CtaNroPad(this);//RePaint(this)" SIZE=12 maxlength=12 ></TD>');
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_clave_coniva" VALUE="'+request.pa_clave_coniva+'" SIZE=3 maxlength=3 ></TD></TR>');
}
writeln('<TR><TD ALIGN=RIGTH><B> Cta. para Gastos sin I.V.A.: </B></TD>');
if (request.waux || !request.lock) {
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_cta_siniva+'</FONT></B><INPUT type="hidden" NAME="pa_cta_siniva" VALUE="'+request.pa_cta_siniva+'" SIZE=12 maxlength=12 ></FONT></TD>');
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_clave_siniva+'</FONT></B><INPUT type="hidden" NAME="pa_clave_siniva" VALUE="'+request.pa_clave_siniva+'" SIZE=3 maxlength=3 ></FONT></TD></TR>');
}
else {
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_cta_siniva" VALUE="'+request.pa_cta_siniva+'" OnChange="CtaNroPad(this);//RePaint(this)" SIZE=12 maxlength=12 ></TD>');
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_clave_siniva" VALUE="'+request.pa_clave_siniva+'" SIZE=3 maxlength=3 ></TD></TR>');
}
writeln('<TR><TD ALIGN=RIGTH><B> Cta. Para Gastos Devolucion: </B></TD>');
if (request.waux || !request.lock) {
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_cta_dev+'</FONT></B><INPUT type="hidden" NAME="pa_cta_dev" VALUE="'+request.pa_cta_dev+'" SIZE=12 maxlength=12 ></FONT></TD>');
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_clave_dev+'</FONT></B><INPUT type="hidden" NAME="pa_clave_dev" VALUE="'+request.pa_clave_dev+'" SIZE=3 maxlength=3 ></FONT></TD></TR>');
}
else {
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_cta_dev" VALUE="'+request.pa_cta_dev+'" OnChange="isNroThis(this);//RePaint(this)" SIZE=12 maxlength=12 ></TD>');
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_clave_dev" VALUE="'+request.pa_clave_dev+'" SIZE=3 maxlength=3 ></TD></TR>');
}
writeln('<TR><TD ALIGN=RIGTH><B> Condición de Pago Bloqueado: </B></TD>');
if (request.waux || !request.lock) {
writeln('<TD ALIGN=RIGTH><FONT COLOR="#800040"><B>'+request.pa_cp_lock+'</FONT></B><INPUT type="hidden" NAME="pa_cp_lock" VALUE="'+request.pa_cp_lock+'" SIZE=4 maxlength=4 ></FONT></TD></TR>');
}
else {
writeln('<TD ALIGN=RIGTH><INPUT TYPE="text" NAME="pa_cp_lock" VALUE="'+request.pa_cp_lock+'" SIZE=4 maxlength=3 ></TD></TR>');
}
writeln('</TABLE></FORM>');
if (!request.waux) {
writeSignature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

358
o_pedido.html Normal file
View File

@ -0,0 +1,358 @@
<TITLE>pedidos</TITLE>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>pedidos</TITLE>
<META NAME="GENERATOR" CONTENT="AdmiSys Sistemas informáticos">
<META NAME="Author" CONTENT="WebTeam">
<META NAME="Organization" CONTENT="AdmiSys S.L.">
<META NAME="Document description" CONTENT="Alta y Modificación de pedidos">
<META NAME="Last modified date" CONTENT="Thursday, February 06, 1997 07:33:31">
</HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
function FormPaint(obj) {
document.f_pedido.action=top.main.document.location.href+"&cookie=1&lock=true";
document.f_pedido.submit();
}
function Chek_fields(obj) {
if ( emptyField(obj.pe_nro_pedido) == true ) {
alert("!!! Es necesario rellenar el Código de pedido !!!->"+obj.pe_nro_pedido.value+"<-");
return false;
}
return true;
}
</SCRIPT>
<SERVER>
// Variables para el Server
var HOY=new Date();
var entorno = new entObj(0);
// Algunos formatos para fechas.
var NLDF=""; // para columnas en las queries INFORMIX
var IFDF=""; // para columnas en SQL según DBDATE
// Algunos formatos para nros.
var NF2=""
var NF3=""
var NF4=""
var NF5=""
var NF6=""
var NF7=""
var NF8=""
var NF9=""
var NF10=""
var NF11=""
var NF12=""
var baseHtml="";
dbAcl();
if ((!request.waux && request.lock) || request.nvo )
LoadParametros();
writeln("<SCRIPT LANGUAGE='JavaScript'>");
if ((!request.waux && request.lock) || request.nvo )
SetParametros();
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln('function RunFunction(obj,valor,clave,f_nro) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.f_pedido;');
writeln(' if ( obj == "Ayuda" ) {');
writeln(' NetHelp(valor);');
writeln(' }');
writeln(' history.back();');
writeln('}');
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
ObjButtons(request.pe_nro_pedido,"Pedidos","pe_");
}
writeln('}');
}
if ( request.ViewFkey == "S" ) {
writeln('function RePaint(obj) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' for ( var i=0; i < document.f_pedido.length; i++ ) { ');
writeln(' if ( document.f_pedido.elements[i].name == obj.name ) ');
writeln(' break; ');
writeln(' } ');
writeln(' document.f_pedido.action=mainFrame.document.location.href+"&cookie=1&nro="+i+"&lock=true"');
writeln(' document.f_pedido.submit();');
writeln('} ');
}
else {
writeln('function ScrollVer(obj) {');
writeln(' status_scroll=true; ');
writeln(' MESSAGE=" ¡¡¡ Los Datos del Pedido han cambiado usar el botón de \'Ver\' para "+ ');
writeln(' " actualizar las referencias de la Base de Datos desde el Servidor !!! " ');
writeln(' scroll = new statusMessageObject(); ');
writeln(' scroller(); ');
writeln('} ');
writeln('function RePaint(obj) {');
writeln(' if (status_scroll != true ) ');
writeln(' ScrollVer(obj); ');
writeln('} ');
}
writeln('function Enfoca(obj) {')
if ( request.nro ) {
writeln('document.f_pedido.elements['+request.nro+'].focus();');
}
writeln('}');
writeln("</SCRIPT>");
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\',\''+request.nvo+'\','+request.nro+')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln('<BODY "');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
if (request.gofunc) {
writeln(' </BODY>');
writeln(' </HTML>');
writeln(' <!--');
}
if (!request.cookie && !request.gofunc) {
dbConnect();
// Vemos que tarea hay que ejecutar:
if (request.add) {
if ( entriesExist(" from pedidos where nro_pedido=\'"+StringClip(true,request.pe_nro_pedido)+"\'") == true ){
redirect("alertpage.html?alert=2");
}
else {
status=database.execute("INSERT INTO pedidos(" +
" nro_pedido," +
" descripcion," +
" nif_proveedor," +
" cod_centro," +
" cond_pago," +
" fecha_pedido," +
" fecha_entrega," +
" importe," +
" observaciones) VALUES ('" + StringClip(true,request.pe_nro_pedido) + "','" +
StringClip(true,request.pe_descripcion) + "','"+
StringClip(true,request.pe_nif_proveedor) + "','"+
StringClip(true,request.pe_cod_centro) + "','"+
StringClip(true,request.pe_cond_pago) + "','"+
DateFormat(request.pe_fecha_pedido,NLDF) + "','"+
DateFormat(request.pe_fecha_entrega,NLDF) + "','"+
NroUnformat(request.pe_importe) + "','"+
StringClip(true,request.pe_observaciones) + "')");
if ( status != 0 )
redirect(addClient('error.html?alert=5'));
DbsError(true,status);
}
redirect(addClient("o_pedido.html?nvo=1&"+baseHtml));
}
//Ejecuta una actualización de la fila sobre la fila actual ...
if (request.upd && request.pe_nro_pedido) {
// if (request.lock)
// c_pedidos.close();
status=database.execute("UPDATE pedidos SET "+
" descripcion='" + StringClip(true,request.pe_descripcion) + "',"+
" nif_proveedor='" + StringClip(true,request.pe_nif_proveedor) + "',"+
" cod_centro='" + StringClip(true,request.pe_cod_centro) + "',"+
" cond_pago='" + StringClip(true,request.pe_cond_pago) + "',"+
" fecha_pedido='" + DateFormat(request.pe_fecha_pedido,NLDF) + "',"+
" fecha_entrega='" + DateFormat(request.pe_fecha_entrega,NLDF) + "',"+
" importe='" + NroUnformat(request.pe_importe) + "',"+
" observaciones='" + StringClip(true,request.pe_observaciones) + "'"+
" WHERE nro_pedido = '" + request.pe_nro_pedido + "'" );
if ( status != 0 )
redirect(addClient('error.html?alert=6'));
DbsError(true,status);
redirect(addClient("g_pedido.html?"+baseHtml));
}
//Ejecuta un borrado de la fila actual ...
if (request.del) {
status=database.execute("DELETE FROM pedidos WHERE nro_pedido = \'" + request.pe_nro_pedido + "\'");
if ( status != 0 )
redirect(addClient('error.html?alert=7'));
DbsError(true,status);
redirect(addClient("g_pedido.html?"+baseHtml));
}
if (request.pe_nro_pedido && !request.upd && !request.add ) {
// Si hay Clave de la tabla seleccionamos los datos ....
//Si se busca la fila ... usando la clave primaria de la relación
if (request.lock)
CursorTabla("pe","nro_pedido","=\'"+request.pe_nro_pedido+"\'",true,true);
else
CursorTabla("pe","nro_pedido","=\'"+request.pe_nro_pedido+"\'",true,"");
// Asignamos a request todas las columnas necesarias para el form.
request.pe_nro_pedido=StringClip(false,c_pedidos.nro_pedido);
request.pe_descripcion=StringClip(false,c_pedidos.descripcion);
request.pe_nif_proveedor=StringClip(false,c_pedidos.nif_proveedor);
request.pe_cod_centro=StringClip(false,c_pedidos.cod_centro);
request.pe_cond_pago=StringClip(false,c_pedidos.cond_pago);
request.pe_fecha_pedido=datetoString(c_pedidos.fecha_pedido);
request.pe_fecha_entrega=datetoString(c_pedidos.fecha_entrega);
request.pe_importe=NroFormat(c_pedidos.importe,NF9);
request.pe_observaciones=StringClip(false,c_pedidos.observaciones);
if (!request.lock)
c_pedidos.close();
if (request.pe_nif_proveedor && request.pe_nif_proveedor != null ) {
CursorTabla("pr","nif","=\'"+StringClip(true,request.pe_nif_proveedor)+"\'",false,false);
request.pe_t_razon_social=c_proveedores.razon_social;
c_proveedores.close();
}
else
request.pe_t_razon_social="";
if (request.pe_cod_centro && request.pe_cod_centro != null ) {
CursorTabla("ce","cod_centro","=\'"+StringClip(true,request.pe_cod_centro)+"\'",false,false);
request.pe_t_des_centro=c_centros.descripcion;
c_centros.close();
}
else
request.pe_t_des_centro="";
if (request.pe_cond_pago && request.pe_cond_pago != null) {
CursorTabla("cp","cond_pago","=\'"+StringClip(true,request.pe_cond_pago)+"\'",false,false);
request.pe_t_des_condpago=c_cond_pago.descripcion;
c_cond_pago.close();
}
else
request.pe_t_des_condpago="";
}
else {
// Estos son los Defaults Reales del Form ... Aquí pueden cambiarse ...
IniciaRequest("pe_");
request.lock=true;
request.pe_t_razon_social="";
request.pe_t_des_centro="";
request.pe_t_des_condpago="";
}
}
else if (!request.gofunc) {
// Se entiende que request contiene todas las columnas necesarias para el form.
// y que esta llamada es para leer y cargar las claves foráneas de la tabla.
if (request.nvo && request.pe_nro_pedido && request.pe_nro_pedido != null ) {
if ( entriesExist(" from pedidos where nro_pedido=\'"+StringClip(true,request.pe_nro_pedido)+"\'") == true ) {
redirect("alertpage.html?alert=2");
}
}
if (request.pe_nif_proveedor && request.pe_nif_proveedor != null ) {
CursorTabla("pr","nif","=\'"+StringClip(true,request.pe_nif_proveedor)+"\'",false,false);
request.pe_t_razon_social=c_proveedores.razon_social;
c_proveedores.close();
}
else
request.pe_t_razon_social="";
if (request.pe_cod_centro && request.pe_cod_centro != null ) {
CursorTabla("ce","cod_centro","=\'"+StringClip(true,request.pe_cod_centro)+"\'",false,false);
request.pe_t_des_centro=c_centros.descripcion;
c_centros.close();
}
else
request.pe_t_des_centro="";
if (request.pe_cond_pago && request.pe_cond_pago != null) {
CursorTabla("cp","cond_pago","=\'"+StringClip(true,request.pe_cond_pago)+"\'",false,false);
request.pe_t_des_condpago=c_cond_pago.descripcion;
c_cond_pago.close();
}
else
request.pe_t_des_condpago="";
}
writeln('<FORM NAME="f_pedido" METHOD="post"');
if (request.pe_nro_pedido && !request.nvo )
htmlpath="o_pedido.html?pe_nro_pedido="+escape(request.pe_nro_pedido)+"&"+baseHtml;
else
htmlpath="o_pedido.html?"+baseHtml;
writeln('action="'+htmlpath+'"');
writeln(' onSubmit="return Chek_fields(this)">');
LoadHidden(htmlpath);
if (!request.waux && request.FrameType == "L" )
ObjHeadBar(request.pe_nro_pedido,"Pedidos","pe_");
writeln(' <CENTER>');
writeln(' <TABLE BORDER=1 ALIGN=CENTER><TR>');
//if (!request.waux)
// writeln('<TD ALIGN=RIGHT><INPUT TYPE="button" VALUE=" Código " ONCLICK="w_auxiliar(\'nro_pedido\',\'nro_pedido\',\'pe_nro_pedido\',\''+request.pe_nro_pedido+'\')">');
//else {
//if (request.waux == 2)
// writeln('<TD></TD><TD align="right" valign="top"><A HREF="javascript:top.close()"><IMG SRC="images/exit1.gif" BORDER=0 HEIGHT=37 WIDTH=44></A></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B> N&uacute;mero: </B></TD>');
//}
if (request.pe_nro_pedido && !request.nvo)
writeln('<TD><FONT COLOR="#800040"><B>'+request.pe_nro_pedido+'</B></FONT><INPUT type="hidden" size=20 name="pe_nro_pedido" VALUE="'+request.pe_nro_pedido+'"></TD>');
else
writeln('<TD><INPUT TYPE="text" NAME="pe_nro_pedido" VALUE="'+request.pe_nro_pedido+'" SIZE=20 OnChange="RePaint(this)"></TD>');
writeln('<TR><TD ALIGN=RIGHT><B>Descripción:</B></TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.pe_descripcion+'</FONT><INPUT type="hidden" name="pe_descripcion" VALUE="'+request.pe_descripcion+'" size=40 maxlength=40></TD></TR>');
else
writeln('<TD><INPUT type="text" name="pe_descripcion" VALUE="'+request.pe_descripcion+'" size=40 maxlength=40></TD></TR>');
// writeln(' onFocus="setStatus(\'\')"');
if (!request.waux || !request.lock)
writeln('<TD ALIGN=RIGHT><INPUT TYPE="button" VALUE=" N.I.F. " ONCLICK="w_auxiliar(\'proveedor\',\'Proveedores\',\'pr_nif\',\''+StringClip(true,request.pe_nif_proveedor)+'\')">');
else {
// if (request.waux == 2)
// writeln('<TD></TD><TD align="right" valign="top"><A HREF="javascript:top.close()"><IMG SRC="images/exit1.gif" BORDER=0 HEIGHT=37 WIDTH=44></A></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B> N.I.F. </B>');
}
if (request.waux || !request.lock)
writeln('<FONT COLOR="#800040"><B>'+request.pe_nif_proveedor+'</B></FONT><INPUT type="hidden" name="pr_nif" VALUE="'+request.pe_nif_proveedor+'"></TD>');
else
writeln('<INPUT TYPE="text" NAME="pe_nif_proveedor" VALUE="'+request.pe_nif_proveedor+'" SIZE=12 OnChange="this.value=this.value.toUpperCase();RePaint(this)"></TD>');
writeln('<TD ALIGN=LEFT>');
writeln('<FONT COLOR="#800040">'+request.pe_t_razon_social+'</FONT></TD></TR>');
if (request.waux || !request.lock)
writeln('<TR><TD ALIGN=RIGHT><B>Centro</B>');
else {
writeln('<TR><TD ALIGN=RIGHT><INPUT TYPE="button" VALUE="Centro" ');
writeln(' ONCLICK="w_auxiliar(\'centro\',\'+Centros\',\'ce_cod_centro\',\''+StringClip(true,request.pe_cod_centro)+'\')">');
}
if (request.waux || !request.lock)
writeln('<FONT COLOR="#800040"><B>'+request.pe_cod_centro+'</B></FONT><INPUT TYPE="hidden" NAME="pe_con_centro" VALUE="'+request.pe_cod_centro+'" SIZE=12 OnChange="RePaint(this)"> </TD>');
else
writeln('<INPUT TYPE="text" NAME="pe_cod_centro" VALUE="'+request.pe_cod_centro+'" SIZE=12 OnChange="RePaint(this)"> </TD>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.pe_t_des_centro+'</FONT></TD>');
if (request.waux || !request.lock)
writeln('<TR><TD ALIGN=RIGHT><B>C.Pago</B>');
else {
writeln('<TR><TD ALIGN=RIGHT><INPUT TYPE="button" VALUE="C.Pago" ');
writeln(' ONCLICK="w_auxiliar(\'condpago\',\'Condiciones_Pago\',\'cp_cond_pago\',\''+StringClip(true,request.pe_cond_pago)+'\')">');
}
if (request.waux || !request.lock)
writeln('<FONT COLOR="#800040"><B>'+request.pe_cond_pago+'</B></FONT><INPUT TYPE="hidden" NAME="pe_cond_pago" VALUE="'+request.pe_cond_pago+'" SIZE=4 OnChange="RePaint(this)"> </TD>');
else
writeln('<INPUT TYPE="text" NAME="pe_cond_pago" VALUE="'+request.pe_cond_pago+'" SIZE=4 OnChange="RePaint(this)"> </TD>');
writeln('<TD ALIGN=LEFTT><FONT COLOR="#800040">'+request.pe_t_des_condpago+'</FONT></TD>');
writeln('<TR><TD><B>Fecha de Pedido:</B> </TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.pe_fecha_pedido+'</B></FONT><INPUT TYPE="hidden" NAME="pe_fecha_pedido" VALUE="'+request.pe_fecha_pedido+'" SIZE=10> </TD></TR>');
else
writeln('<TD> <INPUT TYPE="text" NAME="pe_fecha_pedido" VALUE="'+request.pe_fecha_pedido+'" onBlur="ToStringDate(this,IFDF)" onFocus="UnfrmtStrDate(this,IFDF)" SIZE=10> </TD></TR>');
writeln('<TR><TD><B>Fecha de Entrega:</B> </TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.pe_fecha_entrega+'</B></FONT><INPUT TYPE="hidden" NAME="pe_fecha_pedido" VALUE="'+request.pe_fecha_entrega+'" SIZE=10> </TD></TR>');
else
writeln('<TD> <INPUT TYPE="text" NAME="pe_fecha_entrega" VALUE="'+request.pe_fecha_entrega+'" onBlur="ToStringDate(this,IFDF)" onFocus="UnfrmtStrDate(this,IFDF)" SIZE=10> </TD></TR>');
writeln('<TR><TD><B>Importe:</B> </TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.pe_importe+'</B></FONT><INPUT TYPE="hidden" NAME="pe_fecha_pedido" VALUE="'+request.pe_importe+'" SIZE=15> </TD></TR>');
else
writeln('<TD> <INPUT TYPE="text" NAME="pe_importe" VALUE="'+request.pe_importe+'" onBlur="NroToString(this,NF9)" onFocus="StringToNro(this,NF9)" SIZE=15> </TD></TR>');
writeln('<TR> <TD ALIGN=RIGHT><B>Observaciones: </B> </TD>');
writeln('<FONT COLOR="#800040"><TD ALIGN=LEFT> <TEXTAREA NAME="pe_observaciones" ROWS=4 COLS=30 SIZE=30 maxlength=30 WRAP="virtual">'+request.pe_observaciones+'</TEXTAREA></FONT> </TD> </TR>');
writeln('<TR><TD ALIGN=RIGHT><B>Expediente:</B></TD>');
if (request.waux || !request.lock) {
writeln('<TD><FONT COLOR="#800040"><B>'+request.pe_expediente+'</B></FONT><INPUT type="hidden" name="pe_expediente" VALUE="'+request.pr_expediente+'" size=35 maxlength=40></TD></TR>');
}else
writeln('<TD><INPUT type="text" name="pe_expediente" VALUE="'+request.pe_expediente+'" size=35 maxlength=40></TD></TR>');
writeln('</TABLE></FORM>');
if (!request.waux) {
writeSignature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

406
o_proveedor.html Normal file
View File

@ -0,0 +1,406 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Proveedores</TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/4.0b1 (Win95; I) [Netscape]">
<META NAME="Author" CONTENT="WebTeam">
<META NAME="Organization" CONTENT="AdmiSys S.L.">
<META NAME="Document description" CONTENT="Alta y Modificación de Proveedores">
<META NAME="Last modified date" CONTENT="Thursday, February 06, 1997 07:33:31">
</HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
function FormPaint(obj) {
document.f_proveedor.action=top.main.document.location.href+"&cookie=1&lock=true";
document.f_proveedor.submit();
}
function Chek_fields(obj) {
if ( emptyField(obj.pr_nif) == true ) {
alert("!!! Es necesario rellenar el NIF !!!->"+obj.pr_nif.value+"<-");
return false;
}
return true;
}
</SCRIPT>
<SERVER>
var baseHtml="";
dbAcl();
if ((!request.waux && request.lock) || request.nvo )
LoadParametros();
writeln("<SCRIPT LANGUAGE='JavaScript'>");
if ((!request.waux && request.lock) || request.nvo )
SetParametros();
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln('function RunFunction(obj,valor,clave,f_nro) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.f_proveedor;');
writeln(' if ( obj == "Ayuda" ) {');
writeln(' NetHelp(valor);');
writeln(' }');
writeln(' history.back();');
writeln('}');
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
ObjButtons(request.pr_nif,"Proveedores","pr_");
}
writeln('}');
}
if ( request.ViewFkey == "S" ) {
writeln('function RePaint(obj) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' for ( var i=0; i < document.f_proveedor.length; i++ ) { ');
writeln(' if ( document.f_proveedor.elements[i].name == obj.name ) ');
writeln(' break; ');
writeln(' } ');
writeln(' document.f_proveedor.action=mainFrame.document.location.href+"&cookie=1&nro="+i+"&lock=true"');
writeln(' document.f_proveedor.submit();');
writeln('} ');
}
else {
writeln('function ScrollVer(obj) {');
writeln(' status_scroll=true; ');
writeln(' MESSAGE=" ¡¡¡ Los Datos del Proveedor han cambiado usar el botón de \'Ver\' para "+ ');
writeln(' " actualizar las referencias de la Base de Datos desde el Servidor !!! " ');
writeln(' scroll = new statusMessageObject(); ');
writeln(' scroller(); ');
writeln('} ');
writeln('function RePaint(obj) {');
writeln(' if (status_scroll != true ) ');
writeln(' ScrollVer(obj); ');
writeln('} ');
}
writeln('function Enfoca(obj) {')
if ( request.nro ) {
writeln('document.f_proveedor.elements['+request.nro+'].focus();');
}
writeln('}');
writeln("</SCRIPT>");
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\',\''+request.nvo+'\','+request.nro+')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons()"');
else
writeln(' <BODY');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
if (request.gofunc) {
writeln(' </BODY>');
writeln(' </HTML>');
writeln(' <!--');
}
if (!request.cookie && !request.gofunc) {
dbConnect();
// Vemos que tarea hay que ejecutar:
if (request.add) {
if ( entriesExist(" from proveedores where nif=\'"+StringClip(true,request.pr_nif)+"\'") == true ){
redirect("alertpage.html?alert=2");
}
else {
status=database.execute("INSERT INTO proveedores(" +
" nif," +
" razon_social," +
" cta_contable," +
" cond_pago," +
" domicilio," +
" localidad," +
" cod_postal," +
" attn_envio," +
" direccion_envio," +
" localidad_envio," +
" cod_postal_envio," +
" telefono_1," +
" telefono_2," +
" fax," +
" e_mail," +
" observaciones) VALUES ('" + StringClip(true,request.pr_nif) + "','" +
StringClip(true,request.pr_razon_social) + "','"+
StringClip(true,request.pr_cta_contable) + "','"+
StringClip(true,request.pr_cond_pago) + "','"+
StringClip(true,request.pr_domicilio) + "','"+
StringClip(true,request.pr_localidad) + "','"+
StringClip(true,request.pr_cod_postal) + "','"+
StringClip(true,request.pr_attn_envio) + "','"+
StringClip(true,request.pr_direccion_envio) + "','"+
StringClip(true,request.pr_localidad_envio) + "','"+
StringClip(true,request.pr_cod_postal_envio) + "','"+
StringClip(true,request.pr_telefono_1) + "','"+
StringClip(true,request.pr_telefono_2) + "','"+
StringClip(true,request.pr_fax) + "','"+
StringClip(true,request.pr_e_mail) + "','"+
StringClip(true,request.pr_observaciones) + "')");
if ( status != 0 )
redirect(addClient('error.html?alert=5'));
DbsError(true,status);
}
redirect(addClient("g_proveedor.html?nvo=1&"+baseHtml));
}
//Ejecuta una actualización de la fila sobre la fila actual ...
if (request.upd && request.pr_nif) {
// if (request.lock)
// c_proveedores.close();
status=database.execute("UPDATE proveedores SET "+
" razon_social='" + StringClip(true,request.pr_razon_social) + "',"+
" cta_contable='" + StringClip(true,request.pr_cta_contable) + "',"+
" cond_pago='" + StringClip(true,request.pr_cond_pago) + "',"+
" domicilio='" + StringClip(true,request.pr_domicilio) + "',"+
" localidad='" + StringClip(true,request.pr_localidad) + "',"+
" cod_postal='" + StringClip(true,request.pr_cod_postal) + "',"+
" attn_envio='" + StringClip(true,request.pr_attn_envio) + "',"+
" direccion_envio='" + StringClip(true,request.pr_direccion_envio) + "',"+
" localidad_envio='" + StringClip(true,request.pr_localidad_envio) + "',"+
" cod_postal_envio='" + StringClip(true,request.pr_cod_postal_envio)+"',"+
" telefono_1='" + StringClip(true,request.pr_telefono_1) + "',"+
" telefono_2='" + StringClip(true,request.pr_telefono_2) + "',"+
" fax='" + StringClip(true,request.pr_fax) + "',"+
" e_mail='" + StringClip(true,request.pr_e_mail) + "',"+
" observaciones ='" + StringClip(true,request.pr_observaciones) + "'"+
" WHERE nif = '" + request.pr_nif + "'" );
if ( status != 0 )
redirect(addClient('error.html?alert=6'));
DbsError(true,status);
redirect(addClient("g_proveedor.html?"+baseHtml));
}
//Ejecuta un borrado de la fila actual ...
if (request.del) {
status=database.execute("DELETE FROM proveedores WHERE nif = \'" + request.pr_nif + "\'");
if ( status != 0 )
redirect(addClient('error.html?alert=7'));
DbsError(true,status);
redirect(addClient("g_proveedor.html?"+baseHtml));
}
if (request.pr_nif && !request.upd && !request.add ) {
// Si hay Clave de la tabla seleccionamos los datos ....
//Si se busca la fila ... usando la clave primaria de la relación
if (request.lock)
CursorTabla("pr","nif","=\'"+request.pr_nif+"\'",true,true);
else
CursorTabla("pr","nif","=\'"+request.pr_nif+"\'",true,"");
// Asignamos a request todas las columnas necesarias para el form.
request.pr_nif=StringClip(false,c_proveedores.nif);
request.pr_razon_social=StringClip(false,c_proveedores.razon_social);
request.pr_cta_contable=StringClip(false,c_proveedores.cta_contable);
request.pr_cond_pago=StringClip(false,c_proveedores.cond_pago);
request.pr_domicilio=StringClip(false,c_proveedores.domicilio);
request.pr_localidad=StringClip(false,c_proveedores.localidad);
request.pr_cod_postal=StringClip(false,c_proveedores.cod_postal);
request.pr_attn_envio=StringClip(false,c_proveedores.attn_envio);
request.pr_direccion_envio=StringClip(false,c_proveedores.direccion_envio);
request.pr_localidad_envio=StringClip(false,c_proveedores.localidad_envio);
request.pr_cod_postal_envio=StringClip(false,c_proveedores.cod_postal_envio);
request.pr_telefono_1=StringClip(false,c_proveedores.telefono_1);
request.pr_telefono_2=StringClip(false,c_proveedores.telefono_2);
request.pr_fax=StringClip(false,c_proveedores.fax);
request.pr_e_mail=StringClip(false,c_proveedores.e_mail);
request.pr_observaciones=StringClip(false,c_proveedores.observaciones);
// request.pr_expediente=StringClip(false,c_proveedores.expediente);
if (!request.lock)
c_proveedores.close();
if (request.pr_cta_contable && request.pr_cta_contable != null ) {
CursorTabla("ct","cta_contable","=\'"+StringClip(true,request.pr_cta_contable)+"\'",false,false);
request.pr_t_cta_contable=c_ctas_contables.descripcion;
c_ctas_contables.close();
}
else
request.pr_t_cta_contable="";
if (request.pr_cond_pago && request.pr_cond_pago != null) {
CursorTabla("cp","cond_pago","=\'"+StringClip(true,request.pr_cond_pago)+"\'",false,false);
request.pr_t_condpago=c_cond_pago.descripcion;
c_cond_pago.close();
}
else
request.pr_t_condpago="";
}
else {
// Estos son los Defaults Reales del Form ... Aquí pueden cambiarse ...
IniciaRequest("pr_");
request.lock=true;
request.pr_t_cta_contable="";
request.pr_t_condpago="";
}
}
else if (!request.gofunc) {
// Se entiende que request contiene todas las columnas necesarias para el form.
// y que esta llamada es para leer y cargar las claves foráneas de la tabla.
if (request.nvo && request.pr_nif && request.pr_nif != null ) {
if ( entriesExist(" from proveedores where nif=\'"+StringClip(true,request.pr_nif)+"\'") == true ) {
redirect("alertpage.html?alert=2");
}
}
if (request.pr_cta_contable && request.pr_cta_contable != null ) {
CursorTabla("ct","cta_contable","=\'"+StringClip(true,request.pr_cta_contable)+"\'",false,false);
request.pr_t_cta_contable=c_ctas_contables.descripcion;
c_ctas_contables.close();
}
else
request.pr_t_cta_contable="";
if (request.pr_cond_pago && request.pr_cond_pago != null) {
CursorTabla("cp","cond_pago","=\'"+StringClip(true,request.pr_cond_pago)+"\'",false,false);
request.pr_t_condpago=c_cond_pago.descripcion;
c_cond_pago.close();
}
else
request.pr_t_condpago="";
}
writeln('<FORM NAME="f_proveedor" METHOD="post"');
if (request.pr_nif && !request.nvo )
htmlpath="o_proveedor.html?pr_nif="+escape(request.pr_nif)+"&"+baseHtml;
else
htmlpath="o_proveedor.html?nvo=1"+baseHtml;
writeln('action="'+htmlpath+'"');
writeln(' onSubmit="return Chek_fields(this)">');
LoadHidden(htmlpath);
if (!request.waux && request.FrameType == "L" )
ObjHeadBar(request.pr_nif,"Proveedores","pr_");
writeln(' <CENTER>');
writeln(' <TABLE BORDER=1 ALIGN=CENTER><TR>');
//if (!request.waux)
// writeln('<TD ALIGN=RIGHT><INPUT TYPE="button" VALUE=" N.I.F. " ONCLICK="w_auxiliar(\'proveedor\',\'Proveedores\',\'pr_nif\',\''+request.pr_nif+'\')">');
//else {
//if (request.waux == 2)
// writeln('<TD></TD><TD align="right" valign="top"><A HREF="javascript:top.close()"><IMG SRC="images/exit1.gif" BORDER=0 HEIGHT=37 WIDTH=44></A></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B> N.I.F. </B>');
//}
if (request.pr_nif && !request.nvo)
writeln('<FONT COLOR="#800040"><B>'+request.pr_nif+'</B></FONT><INPUT type="hidden" name="pr_nif" VALUE="'+request.pr_nif+'"></TD>');
else
writeln('<INPUT TYPE="text" NAME="pr_nif" VALUE="'+request.pr_nif+'" SIZE=12 OnChange="this.value=this.value.toUpperCase();RePaint(this)"></TD>');
writeln('<TD ALIGN=RIGTH>');
if (request.waux || !request.lock)
writeln('<FONT COLOR="#800040"><B>'+request.pr_razon_social+'</FONT></B><INPUT type="hidden" NAME="pr_razon_social" VALUE="'+request.pr_razon_social+'" SIZE=40 maxlength=40 ></TD></TR>');
else
writeln('<INPUT TYPE="text" NAME="pr_razon_social" VALUE="'+request.pr_razon_social+'" SIZE=40 maxlength=40 ></TD></TR>');
if (request.waux || !request.lock)
writeln('<TR><TD ALIGN=RIGHT> <B>Cta Contable</B></TD> ');
else {
writeln('<TR><TD ALIGN=RIGHT> <INPUT TYPE="button" VALUE="Cta Contable" ');
writeln(' ONCLICK="w_auxiliar(\'ctascont\',\'Cuentas_Contables\',\'ct_cta_contable\',\''+StringClip(true,request.pr_cta_contable)+'\')"></TD>');
}
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.pr_cta_contable+'<B></FONT> <INPUT TYPE="hidden" NAME="pr_cta_contable" VALUE="'+request.pr_cta_contable+'")</TD></TR>');
else {
writeln('<TD> <INPUT TYPE="text" NAME="pr_cta_contable" VALUE="'+request.pr_cta_contable+'")');
writeln(' onFocus="setStatus(\'Código de Cta. Contable\')"');
writeln(' SIZE='+client.pa_longcta+' OnChange="CtaNroPad(this);RePaint(this)"> </TD></TR>');
}
writeln('<TR><TD ALIGN=RIGHT><B>T&iacute;tulo Cuenta</B></TD>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.pr_t_cta_contable+'</FONT></TD></TR>');
if (request.waux || !request.lock)
writeln('<TR><TD ALIGN=RIGHT><B>C.Pago</B>');
else {
writeln('<TR><TD ALIGN=RIGHT><INPUT TYPE="button" VALUE="C.Pago" ');
writeln(' ONCLICK="w_auxiliar(\'condpago\',\'Condiciones_Pago\',\'cp_cond_pago\',\''+StringClip(true,request.pr_cond_pago)+'\')">');
}
if (request.waux || !request.lock)
writeln('<FONT COLOR="#800040"><B>'+request.pr_cond_pago+'</B></FONT><INPUT TYPE="hidden" NAME="pr_cond_pago" VALUE="'+request.pr_cond_pago+'" SIZE=4 OnChange="RePaint(this)"> </TD>');
else
writeln('<INPUT TYPE="text" NAME="pr_cond_pago" VALUE="'+request.pr_cond_pago+'" SIZE=4 OnChange="RePaint(this)"> </TD>');
writeln('<TD><FONT COLOR="#800040">'+request.pr_t_condpago+'</FONT></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT ><B>Domicilio:</I></TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.pr_domicilio+'</B><INPUT type="hidden" name="pr_domicilio" value="'+request.pr_domicilio+'" size=40 maxlength=40> </TD>');
else
writeln('<TD><INPUT type="text" name="pr_domicilio" value="'+request.pr_domicilio+'" size=40 maxlength=40> </TD>');
writeln('</TR><TR><TD ALIGN=RIGHT><B>Localidad:</B></TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.pr_localidad+'</B></FONT><INPUT TYPE="hidden" NAME="pr_localidad" VALUE="'+request.pr_localidad+'" SIZE=30></TD></TR>');
else
writeln('<TD><INPUT TYPE="text" NAME="pr_localidad" VALUE="'+request.pr_localidad+'" SIZE=30></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B>Cod.Postal:</B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.pr_cod_postal+'</B></FONT><INPUT type="hidden" name="pr_cod_postal" VALUE="'+request.pr_cod_postal+'" size=7 maxlength=7></TD> </TR>');
else
writeln('<TD ALIGN=LEFT><INPUT type="text" name="pr_cod_postal" VALUE="'+request.pr_cod_postal+'" size=7 maxlength=7></TD> </TR>');
writeln('<TR><TD ALIGN=RIGHT> <B>Attn .Envio:</B> </TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=LEFT> <FONT COLOR="#800040"><B>'+request.pr_attn_envio+'</B></FONT><INPUT type="hidden" name="pr_attn_envio" VALUE="'+request.pr_attn_envio+'" size=30 maxlength=40> </TD> </TR>');
else
writeln('<TD ALIGN=LEFT> <INPUT type="text" name="pr_attn_envio" VALUE="'+request.pr_attn_envio+'" size=30 maxlength=40> </TD> </TR>');
writeln('<TR> <TD ALIGN=RIGHT> <B>Direci&oacute;n Envio:</B> </TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.pr_direccion_envio+'</B></FONT><INPUT type="hidden" name="pr_direccion_envio" VALUE="'+request.pr_direccion_envio+'" size=40 maxlength=40> </TD> </TR>');
else
writeln('<TD> <INPUT type="text" name="pr_direccion_envio" VALUE="'+request.pr_direccion_envio+'" size=40 maxlength=40> </TD> </TR>');
writeln('<TR><TD ALIGN=RIGHT><B>Localidad de Envio:</B> </TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.pr_localidad_envio+'</B></FONT><INPUT TYPE="hidden" NAME="pr_localidad_envio" VALUE="'+request.pr_localidad_envio+'" SIZE=30> </TD></TR>');
else
writeln('<TD> <INPUT TYPE="text" NAME="pr_localidad_envio" VALUE="'+request.pr_localidad_envio+'" SIZE=30> </TD></TR>');
writeln('<TR> <TD ALIGN=RIGHT> <B>Cod.Postal Envio:</B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.pr_cod_postal_envio+'</B></FONT><INPUT type="hidden" name="pr_cod_postal_envio" VALUE="'+request.pr_cod_postal_envio+'" size=7 maxlength=7></TD></TR>');
else
writeln('<TD ALIGN=LEFT> <INPUT type="text" name="pr_cod_postal_envio" VALUE="'+request.pr_cod_postal_envio+'" size=7 maxlength=7> </TD> </TR>');
writeln('<TR ALIGN=RIGHT><TD> <B>Tel&eacute;fonos:</B> </TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.pr_telefono_1+'</B></FONT><INPUT type="hidden" name="pr_telefono_1" VALUE="'+request.pr_telefono_1+'" size=14 maxlength=14>');
else
writeln('<TD ALIGN=LEFT> <INPUT type="text" name="pr_telefono_1" VALUE="'+request.pr_telefono_1+'" size=14 maxlength=14>');
if (request.waux || !request.lock)
writeln('<FONT COLOR="#800040"><B>'+request.pr_telefono_2+'</B></FONT><INPUT type="hidden" name="pr_telefono_2" VALUE="'+request.pr_telefono_2+'" size=14 maxlength=14> </TD> </TR>');
else
writeln('<INPUT type="text" name="pr_telefono_2" VALUE="'+request.pr_telefono_2+'" size=14 maxlength=14> </TD> </TR>');
writeln('<TR> <TD ALIGN=RIGHT><B>Nro. Fax:</B> </TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.pr_fax+'</B></FONT><INPUT type="hidden" name="pr_fax" VALUE="'+request.pr_fax+'" size=14 maxlength=14> </TD> </TR>');
else
writeln('<TD><INPUT type="text" name="pr_fax" VALUE="'+request.pr_fax+'" size=14 maxlength=14> </TD> </TR>');
writeln('<TR> <TD ALIGN=RIGHT><B>Correo Electr&oacute;nico:</B> </TD>');
if (request.waux || !request.lock)
writeln('<TD><FONT COLOR="#800040"><B>'+request.pr_e_mail+'</B></FONT><INPUT type="hidden" name="pr_e_mail" VALUE="'+request.pr_e_mail+'" size=30 maxlength=30> </TD></TR>');
else
writeln('<TD> <INPUT type="text" name="pr_e_mail" VALUE="'+request.pr_e_mail+'" size=30 maxlength=30> </TD></TR>');
writeln('<TR> <TD ALIGN=RIGHT><B>Observaciones: </B> </TD>');
writeln('<FONT COLOR="#800040"><TD ALIGN=LEFT> <TEXTAREA NAME="pr_observaciones" ROWS=4 COLS=30 SIZE=30 maxlength=30 WRAP="virtual">'+request.pr_observaciones+' </TEXTAREA> </TD> </TR>');
writeln('<TR><TD ALIGN=RIGHT><B>Expediente:</B></TD>');
if (request.waux || !request.lock) {
writeln('<TD><FONT COLOR="#800040"><B>'+request.pr_expediente+'</B></FONT><INPUT type="hidden" name="pr_expediente" VALUE="'+request.pr_expediente+'" size=35 maxlength=40></TD></TR>');
}else
writeln('<TD><INPUT type="text" name="pr_expediente" VALUE="'+request.pr_expediente+'" size=35 maxlength=40></TD></TR>');
writeln('</TABLE></FORM>');
if (!request.waux) {
writeSignature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

404
o_unlockfra.html Normal file
View File

@ -0,0 +1,404 @@
<!---
application: Cuentas a Pagar
version: 1.0.0
filename: g_unlockfra.html
description: Esta página busca las filas de la tabla de acuerdo con el
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
poder ver los detalles completos, modificarla o Borrala.
El botón de Alta permite acceder al form para crear una nueva fila
--->
<HTML>
<HEAD>
<TITLE>Gestion de facturas</TITLE>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
</HEAD>
<SERVER>
var NF7=""
var NF9=""
var NF10=""
var HOY=new Date();
// Algunos formatos para fechas.
var NLDF=""; // para columnas en las queries INFORMIX
var baseHtml="";
dbAcl();
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons();GoField()"');
else
writeln(' <BODY OnLoad="GoField()"');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
writeln('<SCRIPT SRC="global.js">');
writeln('</SCRIPT>');
writeln('<SCRIPT SRC="ctasapagar.js">');
writeln('</SCRIPT>');
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln(' function Chek_fields(obj) {');
writeln(' var f=document.f_unlockfra; ');
writeln(' if ( f.unlock.value=="Ejecurar" ) { ');
writeln(' if (confirm("!!! Confirmar Tarea !!!"))');
writeln(' return true;');
writeln(' else ');
writeln(' return false;');
writeln(' } ');
writeln(' else ');
writeln(' return true;');
writeln(' }');
writeln(' function GoField() {');
writeln(' var f=document.f_unlockfra; ');
if ( request.unlock=="Ejecutar" ) {
writeln(' alert("¡¡¡ Acción realizada ...\\r sobre el documento !!!"); ');
}
if ( request.unlock=="Buscar" )
writeln(' f.totalDocs.focus();');
if ( request.unlock=="Ejecutar" || !request.unlock )
writeln(' f.d_nro_regn.focus();');
writeln(' }');
writeln(' function chkYearNroReg(obj) {');
writeln(' var nro=parseInt(obj.value); ');
writeln(' if (nro+1 > 0 ) { ');
writeln(' obj.value=nro; ');
writeln(' if ( HOY.getFullYear() != nro ) ');
writeln(' alert("¡¡ El Año del Nro. de Registro no es el actual !! ");');
writeln(' }');
writeln(' }');
writeln('function NroPad(obj,longNro) {');
writeln(' if ( obj.value.length == 0 )');
writeln(' return;');
writeln(' if (obj.value.indexOf("*") >= 0) ');
writeln(' return;');
writeln(' c_nro=obj.value;');
writeln(' for (var j=c_nro.length ; j<longNro ; j++ ) {');
writeln(' c_nro="0"+c_nro;');
writeln(' }');
writeln(' obj.value=c_nro.substring(0,longNro);');
writeln('}');
if (request.gofunc) {
writeln('function RunFunction(obj,valor) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_frame=mainFrame.document.f_unlockfra;');
writeln(' if ( obj == "Alta" ) {');
writeln(' f_frame.action="o_factura.html?nvo=1&'+baseHtml+'";');
writeln(' f_frame.submit(); ');
writeln(' }');
writeln(' if ( obj == "Ayuda" )');
writeln(' NetHelp(valor);');
writeln(' history.back();');
writeln('}');
}
writeln('</SCRIPT>');
if( request.unlock) {
if (!request.gofunc) {
dbConnect();
if (request.unlock) {
var criterio="";
if ( request.f_desde.length > 0 ) {
var f_desde=DateFormat(request.f_desde,NLDF);
if ( f_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
criterio=" f_emision >= '"+f_desde+"' "
}
if ( request.f_hasta.length > 0 ) {
var f_hasta=DateFormat(request.f_hasta,NLDF);
if ( f_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" f_emision <= '"+f_hasta+"' "
}
if ( request.v_desde.length > 0 ) {
var v_desde=DateFormat(request.v_desde,NLDF);
if ( v_desde.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago >= '"+v_desde+"' "
}
if ( request.v_hasta.length > 0 ) {
var v_hasta=DateFormat(request.v_hasta,NLDF);
if ( v_hasta.substring(0,1) == "-" )
redirect("alertpage.html?alert=3");
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" vto_pago <= '"+v_hasta+"' "
}
if ( request.h_cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" cod_centro <= '"+request.d_cod_centro+"' and cod_centro >= '"+request.h_cod_centro+"' "
} else {
if ( request.d_cod_centro.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" cod_centro matches '"+request.d_cod_centro+"'"
}
}
if ( request.nif.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nif matches '"+request.nif+"'"
}
if ( request.h_nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_fra >= '"+request.d_nro_fra+"' and facturas.nro_fra <= '"+request.h_nro_fra+"'"
} else {
if ( request.d_nro_fra.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_fra matches '"+request.d_nro_fra+"'"
}
}
if ( request.h_nro_regn.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_reg >= '"+StringClip(true,request.d_nro_regy)+StringClip(true,request.d_nro_regn);
criterio=criterio+"' and facturas.nro_reg <= '"+StringClip(true,request.h_nro_regy)+StringClip(true,request.h_nro_regn)+"'"
} else {
if ( request.d_nro_regn.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_reg matches '"+StringClip(true,request.d_nro_regy)+StringClip(true,request.d_nro_regn)+"'"
}
}
if ( request.h_nro_reg_vton.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_reg_vto >= '"+StringClip(true,request.d_nro_reg_vtoy)+StringClip(true,request.d_nro_reg_vton)+"' and facturas.nro_reg_vto <= '"+StringClip(true,request.h_nro_reg_vtoy)+StringClip(true,request.h_nro_reg_vton)+"'"
} else {
if ( request.d_nro_reg_vton.length > 0 ) {
if (criterio.length > 0 )
criterio=criterio+" and "
criterio=criterio+" facturas.nro_reg_vto matches '"+StringClip(true,request.d_nro_reg_vtoy)+StringClip(true,request.d_nro_reg_vton)+"'"
}
}
if ( request.pago_delete && request.unlock=="Ejecutar" ) {
client.is_trans=true;
database.beginTransaction();
status=database.execute("UPDATE facturas SET "+
" is_locked='N',"+
" nro_doc_pago='',"+
" f_emision_pago='',"+
" cod_localidad='',"+
" cod_banco='',"+
" vto_pago=''"+
" WHERE " + criterio );
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect(addClient('error.html?alert=9'));
}
DbsError(true,status);
database.commitTransaction();
}
if ( request.vto_pago_upd && request.unlock=="Ejecutar" && request.vto_pago.length > 0 ) {
client.is_trans=true;
database.beginTransaction();
status=database.execute("UPDATE facturas SET "+
" vto_pago='"+ DateFormat(request.vto_pago,NLDF)+"'"+
" WHERE " + criterio );
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect(addClient('error.html?alert=9'));
}
DbsError(true,status);
database.commitTransaction();
}
if ( request.no_lock && request.unlock=="Ejecutar" ) {
status = database.execute("UPDATE facturas set is_locked='N' WHERE "+ criterio );
}
if ( request.lock_fra && request.unlock=="Ejecutar" ) {
status = database.execute("UPDATE facturas set is_locked='S' WHERE "+ criterio );
}
if ( request.trasp_gasto && request.unlock=="Ejecutar" ) {
status = database.execute("UPDATE facturas set traspaso_gasto='N' WHERE "+ criterio );
}
if ( request.trasp_pago && request.unlock=="Ejecutar" ) {
status = database.execute("UPDATE facturas set traspaso_pago='N' WHERE "+ criterio );
}
if ( request.trasp_vto && request.unlock=="Ejecutar" ) {
status = database.execute("UPDATE facturas set traspaso_vto='N' WHERE "+ criterio );
}
if ( request.unlock=="Ejecutar" )
request.unlock="Buscar";
}
}
}
nombre="Gestión";
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('</SCRIPT>');
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln("<SCRIPT LANGUAGE='JavaScript'>");
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=mainFrame.document.location.href;');
QueryButtons("Facturas",nombre,"rpt");
}
writeln('}');
writeln("</SCRIPT>");
}
if (!request.waux) {
if (request.gofunc) {
writeln('</BODY>');
writeln('</HTML>');
writeln(' <!--');
}
else {
if ( request.FrameType == "L" ) {
writeln('<FORM METHOD="post" ACTION="o_unlockfra.html?'+baseHtml+'&nvo=1" onSubmit="return Chek_fields(this)">');
QueryHeadBar("Facturas",nombre,"ulk")
writeln('</FORM>');
}
writeln('<FORM NAME="f_unlockfra" method="Post" action="o_unlockfra.html?'+baseHtml+'" onSubmit="return Chek_fields(this)">');
}
}
else {
writeln('<FORM NAME="f_unlockfra" method="Post" action="o_unlockfra.html?waux='+request.waux+'&'+baseHtml+'" onSubmit="return Chek_fields(this)">');
writeln('<CENTER><FONT SIZE=+2>'+nombre+' </FONT></FONT></H1></CENTER>');
}
if ( !request.unlock || request.unlock=="Buscar" ) {
writeln("<B>Criterios de Seleccion Datos: </B>");
writeln("<HR>");
if (!request.nif)
request.nif="";
if (!request.d_cod_centro)
request.d_cod_centro="";
if (!request.h_cod_centro)
request.h_cod_centro="";
if (!request.d_nro_fra)
request.d_nro_fra="";
if (!request.h_nro_fra)
request.h_nro_fra="";
if (!request.f_desde)
request.f_desde="";
if (!request.f_hasta)
request.f_hasta="";
if (!request.v_desde)
request.v_desde="";
if (!request.v_hasta)
request.v_hasta="";
if (!request.d_nro_regn)
request.d_nro_regn="";
if (!request.d_nro_regy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.d_nro_regy=n;
}
if (!request.h_nro_regn)
request.h_nro_regn="";
if (!request.h_nro_regy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.h_nro_regy=n;
}
if (!request.d_nro_reg_vton)
request.d_nro_reg_vton="";
if (!request.d_nro_reg_vtoy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.d_nro_reg_vtoy=n;
}
if (!request.h_nro_reg_vton)
request.h_nro_reg_vton="";
if (!request.h_nro_reg_vtoy) {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.h_nro_reg_vtoy=n;
}
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<INPUT TYPE="submit" value="Buscar">');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Reg.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_regn" VALUE="'+request.d_nro_regn+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="d_nro_regy" VALUE="'+request.d_nro_regy+'" SIZE=4 OnChange="chkYearNroReg(this)">');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_regn" VALUE="'+request.h_nro_regn+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="h_nro_regy" VALUE="'+request.h_nro_regy+'" SIZE=4 OnChange="chkYearNroReg(this)"><INPUT TYPE="submit" value=" / "></TD>');
writeln('<TR><TD ALIGN=LEFT><B>Nro.Fra.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_fra" VALUE="'+request.d_nro_fra+'" SIZE=12 >');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_fra" VALUE="'+request.h_nro_fra+'" SIZE=12 > </TD>');
writeln("<TR><TD ALIGN=LEFT>N.I.F. .......: </TD><TD><INPUT type='text' name='nif' size=12 maxlength=12 VALUE='"+request.nif +"' onChange='this.value=this.value.toUpperCase()' > </TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Código Centro Desde: </TD><TD><INPUT type='text' name='d_cod_centro' size=12 maxlength=12 VALUE='"+request.d_cod_centro +"' >");
writeln("Hasta: <INPUT type='text' name='h_cod_centro' size=12 maxlength=12 VALUE='"+request.h_cod_centro +"' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Emitida Desde: </TD><TD><INPUT type='text' name='f_desde' size=8 maxlength=10 VALUE='"+request.f_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='f_hasta' size=8 maxlength=10 VALUE='"+request.f_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"emision\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"emision\")' ></TD></TR>");
writeln("<TR><TD ALIGN=LEFT>Vto. Pago Desde: </TD><TD><INPUT type='text' name='v_desde' size=8 maxlength=10 VALUE='"+request.v_desde +"' onBlur='ToStringDate(this,IFDF)' onFocus='UnfrmtStrDate(this,IFDF)' >");
writeln("Hasta: <INPUT type='text' name='v_hasta' size=8 maxlength=10 VALUE='"+request.v_hasta +"' onBlur='ToStringDate(this,IFDF)' onFocus='HastaDefault(this,\"vto\");UnfrmtStrDate(this,IFDF)' onChange='RangoFecha(this,\"vto\")''></TD></TR>");
writeln('<TR><TD ALIGN=LEFT><B>Nro.Apte Vto.Desde: </B></TD><TD><INPUT TYPE="text" NAME="d_nro_reg_vton" VALUE="'+request.d_nro_reg_vton+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="d_nro_reg_vtoy" VALUE="'+request.d_nro_reg_vtoy+'" SIZE=4 OnChange="chkYearNroReg(this)">');
writeln('Hasta: <INPUT TYPE="text" NAME="h_nro_reg_vton" VALUE="'+request.h_nro_reg_vton+'" OnChange="NroPad(this,5)" SIZE=5 > <INPUT TYPE="text" NAME="h_nro_reg_vtoy" VALUE="'+request.h_nro_reg_vtoy+'" SIZE=4 OnChange="chkYearNroReg(this)"><INPUT TYPE="submit" value=" / "></TD>');
writeln('</TD></TR></TABLE>');
writeln("<INPUT type='hidden' name='unlock' size=8 maxlength=10 VALUE='Seleccion' >");
writeln('<INPUT TYPE="submit" value="Buscar">');
}
else {
request.totalDocs=0;
query = database.cursor("SELECT count(*) FROM facturas,proveedores WHERE facturas.nif=proveedores.nif "+
" and "+criterio);
if (query.next()) {
request.totalDocs=query[0];
}
query.close();
writeln('<HR>');
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TR><TD ALIGN=LEFT><B>Nro. Docs:</B><INPUT TYPE="text" NAME="totalDocs" VALUE="'+NroFormat(request.totalDocs,NF7)+'" OnChange="" SIZE=12 ></TD><TR>');
writeln('</TABLE>');
writeln('<HR>');
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
writeln('<TR><TD ALIGN=LEFT><B><I><FONT COLOR="#800040">Desbloquear:</FONT></B><INPUT TYPE="submit" name="no_lock" value="Desbloqueo de Facturas"></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B><I>Bloquear:</B><INPUT TYPE="submit" name="lock_fra" value="Bloqueo de Facturas"></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B><I>Cancelar:</B><INPUT TYPE="submit" name="pago_delete" value="Datos de Pago"></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B><I>Cancelar Traspaso de:</B><INPUT TYPE="submit" name="trasp_gasto" value="Gasto"></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B><I>Cancelar Traspaso de:</B><INPUT TYPE="submit" name="trasp_pago" value="Pago"></TD></TR>');
writeln('<TR><TD ALIGN=LEFT><B><I>Cancelar Traspaso de:</B><INPUT TYPE="submit" name="trasp_vto" value="Vencimiento"></TD></TR></I>');
writeln('<TR><TD ALIGN=LEFT><B><I>Cambiar Vto. Pago a:</B><INPUT TYPE="submit" name="vto_pago_upd" value="Nueva fecha:"><INPUT type="text" name="vto_pago" size=8 maxlength=10 VALUE="" onBlur="ToStringDate(this,IFDF)" onFocus="UnfrmtStrDate(this,IFDF)" >');
writeln('</TABLE>');
writeln("<INPUT type='hidden' name='unlock' size=8 maxlength=10 VALUE='Ejecutar' >");
writeln('<INPUT TYPE="hidden" NAME="d_nro_regn" VALUE="'+request.d_nro_regn+'" > <INPUT TYPE="hidden" NAME="d_nro_regy" VALUE="'+request.d_nro_regy+'" >');
writeln('<INPUT TYPE="hidden" NAME="h_nro_regn" VALUE="'+request.h_nro_regn+'" > <INPUT TYPE="hidden" NAME="h_nro_regy" VALUE="'+request.h_nro_regy+'" >');
writeln('<INPUT TYPE="hidden" NAME="d_nro_fra" VALUE="'+request.d_nro_fra+'" >');
writeln('<INPUT TYPE="hidden" NAME="h_nro_fra" VALUE="'+request.h_nro_fra+'">');
writeln("<INPUT type='hidden' name='nif' VALUE='"+request.nif +"' >");
writeln("<INPUT type='hidden' name='d_cod_centro' VALUE='"+request.d_cod_centro +"' >");
writeln("<INPUT type='hidden' name='h_cod_centro' VALUE='"+request.h_cod_centro +"' ></TD></TR>");
writeln("<INPUT type='hidden' name='f_desde' VALUE='"+request.f_desde +"' >");
writeln("<INPUT type='hidden' name='f_hasta' VALUE='"+request.f_hasta +"' >");
writeln("<INPUT type='hidden' name='v_desde' VALUE='"+request.v_desde +"' >");
writeln("<INPUT type='hidden' name='v_hasta' VALUE='"+request.v_hasta +"' >");
writeln('<INPUT TYPE="hidden" NAME="d_nro_reg_vton" VALUE="'+request.d_nro_reg_vton+'" > <INPUT TYPE="hidden" NAME="d_nro_reg_vtoy" VALUE="'+request.d_nro_reg_vtoy+'">');
writeln('<INPUT TYPE="hidden" NAME="h_nro_reg_vton" VALUE="'+request.h_nro_reg_vton+'" > <INPUT TYPE="hidden" NAME="h_nro_reg_vtoy" VALUE="'+request.h_nro_reg_vtoy+'">');
}
writeln('</FORM>');
writeln("<CENTER>");
if (!request.waux) {
refHtml="o_unlockfra.html?"+baseHtml+"&search2=";
}
else {
refHtml="o_unlockfra.html?waux="+request.waux+"&"+baseHtml+"&search2=";
}
LoadHidden(refHtml);
if (!request.waux)
writeSignature(true);
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

492
o_vto.html Normal file
View File

@ -0,0 +1,492 @@
<TITLE>Factura</TITLE>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>facturas</TITLE>
<META NAME="GENERATOR" CONTENT="AdmiSys Sistemas informáticos">
<META NAME="Author" CONTENT="WebTeam">
<META NAME="Organization" CONTENT="AdmiSys S.L.">
<META NAME="Document description" CONTENT="Alta y Modificación de facturas Internos">
<META NAME="Last modified date" CONTENT="Thursday, February 06, 1997 07:33:31">
</HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SERVER>
// Variables para el Server
var HOY=new Date();
var entorno = new entObj(0);
var NF11=""
var baseHtml="";
var whitespace="";
dbAcl();
//if ((!request.waux && request.lock) || request.nvo )
LoadParametros();
writeln("<SCRIPT LANGUAGE='JavaScript'>");
//if ((!request.waux && request.lock) || request.nvo )
SetParametros();
writeln(' function setNroReg(obj) {');
writeln(' document.f_factura.fa_nro_remesa.value=StringClip(true,document.f_factura.fa_nro_remesay.value)+StringClip(true,document.f_factura.fa_nro_remesan.value);');
writeln(' }');
writeln(' function chkYearNroReg(obj) {');
writeln(' var nro=0;');
writeln(' nro=parseInt(obj.value); ');
writeln(' obj.value=nro; ');
writeln(' if ( HOY.getFullYear() != nro ) ');
writeln(' alert("¡¡ El Año del Nro. de Registro no es el actual !! ");');
writeln(' }');
writeln('function FormPaint(obj) {');
writeln(' document.f_factura.action=document.f_factura.htmlBaseRef.value+"&cookie=1&lock=true"');
writeln(' document.f_factura.submit();');
writeln(' } ');
writeln(' function GoField() {');
writeln(' var f=document.f_factura; ');
if ( request.prt) {
var nremesay=""+request.prt.substring(0,4);
var nremesan=""+request.prt.substring(4,10);
writeln(' alert("\\rNro. Registro Vto: '+nremesan+'/'+nremesay+' Actualizado.\\r"); ');
}
if (request.exec=="add" || request.exec == "upd" )
writeln(' f.submit(); ');
writeln(' f.fa_nro_doc_pago.focus();');
writeln(' }');
writeln(' function Chek_fields(obj) {');
if (request.waux || !request.lock)
writeln(' return true;');
else {
writeln(' if ( emptyField(obj.fa_nro_doc_pago) == true ) { ');
writeln(' alert("!!! Es necesario rellenar el Nro. de documento de Pago !!!->"+obj.fa_nro_doc_pago.value+"<-");');
writeln(' return false;');
writeln(' };');
writeln(' return true;');
}
writeln(' }');
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln('function RunFunction(obj,valor,clave,f_nro) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_form=mainFrame.document.f_factura;');
writeln(' if ( obj == "Ayuda" ) {');
writeln(' NetHelp(valor);');
writeln(' }');
writeln(' history.back();');
writeln('}');
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=document.f_factura.htmlBaseRef.value;');
ObjButtons(request.fa_nro_reg,"Facturas","fa_");
}
writeln('}');
}
if ( request.ViewFkey == "S" ) {
writeln('function RePaint(obj) {');
writeln(' for ( var i=0; i < document.f_factura.length; i++ ) { ');
writeln(' if ( document.f_factura.elements[i].name == obj.name ) ');
writeln(' break; ');
writeln(' } ');
writeln(' document.f_factura.action=document.f_factura.htmlBaseRef.value+"&cookie=1&nro="+nl+"&lock=true"');
writeln(' document.f_factura.submit();');
writeln('} ');
}
else {
writeln('function ScrollVer(obj) {');
writeln(' status_scroll=true; ');
writeln(' MESSAGE=" ¡¡¡ Usar el botón de \'Ver\' para "+ ');
writeln(' " actualizar los valores de la Base de Datos desde el Servidor !!! " ');
writeln(' scroll = new statusMessageObject(); ');
writeln(' scroller(); ');
writeln('} ');
writeln('function RePaint(obj) {');
writeln(' if (status_scroll != true ) ');
writeln(' ScrollVer(obj); ');
writeln('} ');
}
writeln("</SCRIPT>");
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\',\''+request.nvo+'\','+request.nro+')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons(); GoField();//SumaLineas(this)"');
else
writeln('<BODY OnLoad="GoField();//SumaLineas(this)" ');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
if (request.gofunc) {
writeln(' </BODY>');
writeln(' </HTML>');
writeln(' <!--');
}
if (!request.cookie && !request.gofunc) {
dbConnect();
// Vemos que tarea hay que ejecutar:
if (request.add && request.fa_nro_doc_pago.length > 1 && request.fa_nro_remesa) {
client.is_trans=true;
database.beginTransaction();
if ( request.fa_nro_remesan == "+" ) {
c_parametros=database.cursor("SELECT nro_remesa FROM parametros WHERE id='1'");
status=c_parametros.next();
var nro_remesa=StringClip(false,c_parametros.nro_remesa);
var lon=nro_remesa.length;
if ( lon > 4 ) {
var updParams=true;
var nroremesan=parseFloat(c_parametros.nro_remesa.substring(4,lon))+1;
request.nro_remesan=NroFormat(nroremesan,"00000");
request.nro_remesay=c_parametros.nro_remesa.substring(0,4);
}
else {
var updParams=true;
request.nro_remesay="";
request.nroremesan=parseInt(nro_remesa)+1;
request.nro_remesan=NroFormat(request.nroremesan,"00000");
}
project.lock();
}
else {
var updParams=false;
request.nro_remesan=request.fa_nro_remesan;
request.nro_remesay=request.fa_nro_remesay;
}
request.fa_nro_remesa=request.nro_remesay+request.nro_remesan;
status=database.execute("UPDATE facturas SET "+
" nro_reg_vto='" + StringClip(true,request.fa_nro_remesa) + "'"+
" WHERE nro_doc_pago = '" + request.fa_nro_doc_pago + "'" );
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
project.unlock();
redirect(addClient('error.html?alert=8'));
}
DbsError(true,status);
if ( updParams == true ) {
status=database.execute("UPDATE parametros SET "+
" nro_remesa='" +request.fa_nro_remesa + "'"+
" WHERE id = '1'" );
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect(addClient('error.html'));
}
}
database.commitTransaction();
client.is_trans=false;
if ( updParams == true )
project.unlock();
redirect(addClient("o_vto.html?nvo=1&prt="+request.fa_nro_remesa+"&"+baseHtml));
}
//Ejecuta una actualización de la fila sobre la fila actual ...
if (request.upd && request.fa_nro_doc_pago.length > 1 ) {
if (request.lock)
client.is_trans=true;
database.beginTransaction();
status=database.execute("UPDATE facturas SET "+
" nro_reg_vto='" + StringClip(true,request.fa_nro_remesa) + "'"+
" WHERE nro_doc_pago = '" + request.fa_nro_doc_pago + "'" );
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect(addClient('error.html?alert=9'));
}
DbsError(true,status);
DelFraLins();
InsFraLins();
database.commitTransaction();
client.is_trans=false;
redirect(addClient("g_vto.html?prt="+request.fa_nro_remesa+"&"+baseHtml));
}
//Ejecuta un borrado de la fila actual ...
if (request.del && request.fa_nro_doc_pago.length > 1 ) {
client.is_trans=true;
database.beginTransaction();
status=database.execute("UPDATE facturas SET "+
" nro_reg_vto=''"+
" WHERE nro_doc_pago = '" + request.fa_nro_doc_pago + "'" );
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect(addClient('error.html?alert=10'));
}
DbsError(true,status);
DelFraLins();
database.commitTransaction();
client.is_trans=false;
redirect(addClient("g_vto.html?"+baseHtml));
}
if (request.fa_nro_reg && !request.upd && !request.add ) {
// Si hay Clave de la tabla seleccionamos los datos ....
//Si se busca la fila ... usando la clave primaria de la relación
if (request.lock) {
client.is_trans=true;
database.beginTransaction();
CursorTabla("fa","nro_reg","=\'"+request.fa_nro_reg+"\'",true,true);
}
else
CursorTabla("fa","nro_reg","=\'"+request.fa_nro_reg+"\'",true,"");
// Asignamos a request todas las columnas necesarias para el form.
request.fa_nro_remesa=StringClip(false,c_facturas.nro_reg_vto);
if ( request.fa_nro_remesa.length > 2 ) {
var lon=request.fa_nro_remesa.length;
request.fa_nro_remesan=request.fa_nro_remesa.substring(4,lon);
request.fa_nro_remesay=request.fa_nro_remesa.substring(0,4);
} else {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.fa_nro_remesan="+";
request.fa_nro_remesay=n;
request.fa_nro_remesa="+"+n
}
request.fa_nro_remesa=StringClip(false,c_facturas.nro_reg_vto);
var lon=request.fa_nro_remesa.length;
request.fa_nro_remesan=request.fa_nro_remesa.substring(4,lon);
request.fa_nro_remesay=request.fa_nro_remesa.substring(0,4);
request.fa_nro_reg=StringClip(false,c_facturas.nro_reg);
var lon=request.fa_nro_reg.length;
request.fa_nro_regn=request.fa_nro_reg.substring(4,lon);
request.fa_nro_regy=request.fa_nro_reg.substring(0,4);
request.fa_nro_fra=StringClip(false,c_facturas.nro_fra);
request.fa_nif=StringClip(false,c_facturas.nif);
request.fa_cod_centro=StringClip(false,c_facturas.cod_centro);
request.fa_nro_doc_pago=StringClip(true,c_facturas.nro_doc_pago);
request.fa_f_emision_pago=datetoString(c_facturas.f_emision_pago);
request.fa_cod_localidad=StringClip(false,c_facturas.cod_localidad);
request.fa_cod_banco=StringClip(true,c_facturas.cod_banco);
request.fa_importe_total=NroFormat(c_facturas.importe_total,NF11);
request.fa_nro_reg_vto=StringClip(false,c_facturas.nro_reg_vto);
request.fa_vto_pago=datetoString(c_facturas.vto_pago);
request.fa_is_locked=StringClip(false,c_facturas.is_locked);
c_facturas.close();
// if (request.fa_is_locked == "S" )
// request.waux=8;
if (request.fa_cod_centro && request.fa_cod_centro != null ) {
CursorTabla("ce","cod_centro","=\'"+StringClip(true,request.fa_cod_centro)+"\'",false,false);
request.fa_t_des_centro=c_centros.descripcion;
c_centros.close();
}
else
request.fa_t_des_centro="";
if (request.fa_nif && request.fa_nif != null ) {
CursorTabla("pr","nif","=\'"+StringClip(true,request.fa_nif)+"\'",false,false);
request.fa_t_razon_social=StringClip(false,c_proveedores.razon_social);
if ( request.fa_t_razon_social == " " ) {
request.fa_t_razon_social="NO EXISTE";
request.fa_cta_contable="";
}
else {
request.fa_cta_contable=StringClip(false,c_proveedores.cta_contable);
}
c_proveedores.close();
}
else {
request.fa_t_razon_social="";
request.fa_cta_contable="";
}
if (request.fa_cod_banco && request.fa_cod_banco != null ) {
CursorTabla("ba","cod_banco","=\'"+StringClip(true,request.fa_cod_banco)+"\'",false,false);
request.fa_t_nombre_banco=c_bancos.nombre;
c_bancos.close();
}
else
request.fa_t_nombre_banco="";
if (request.fa_nro_doc_pago != "" )
clave=request.fa_nro_doc_pago;
else
clave="=";
CursorTabla("fa","nro_doc_pago","=\'"+clave+"\'",true,"");
}
else {
// Estos son los Defaults Reales del Form ... Aquí pueden cambiarse ...
IniciaRequest("fa_");
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.fa_nro_remesan="+";
request.fa_nro_remesay=n;
request.fa_nro_remesa="+"+n
request.fa_nro_reg="";
request.lock=true;
request.fa_t_razon_social="";
request.fa_cta_contable="";
request.fa_t_des_centro="";
request.fa_t_nombre_banco="";
request.fa_t_condpago="";
request.fa_cp_vto=0;
request.fa_importe_total=0;
}
}
else if (!request.gofunc) {
// Se entiende que request contiene todas las columnas necesarias para el form.
// y que esta llamada es para leer y cargar las claves foráneas de la tabla.
if (request.fa_nro_doc_pago != "" && !request.upd && !request.add ) {
// Si hay Clave de la tabla seleccionamos los datos ....
//Si se busca la fila ... usando la clave primaria de la relación
clave=request.fa_nro_doc_pago;
} else {
clave="=";
}
CursorTabla("fa","nro_doc_pago","=\'"+clave+"\'",true,"");
// Asignamos a request todas las columnas necesarias para el form.
request.fa_nro_remesa=StringClip(false,c_facturas.nro_reg_vto);
if ( request.fa_nro_remesa.length > 2 ) {
var lon=request.fa_nro_remesa.length;
request.fa_nro_remesan=request.fa_nro_remesa.substring(4,lon);
request.fa_nro_remesay=request.fa_nro_remesa.substring(0,4);
} else {
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.fa_nro_remesan="+";
request.fa_nro_remesay=n;
request.fa_nro_remesa="+"+n
}
request.fa_nro_reg=StringClip(false,c_facturas.nro_reg);
var lon=request.fa_nro_reg.length;
request.fa_nro_regn=request.fa_nro_reg.substring(4,lon);
request.fa_nro_regy=request.fa_nro_reg.substring(0,4);
request.fa_nro_fra=StringClip(false,c_facturas.nro_fra);
request.fa_nif=StringClip(false,c_facturas.nif);
request.fa_cod_centro=StringClip(false,c_facturas.cod_centro);
request.fa_nro_doc_pago=StringClip(true,c_facturas.nro_doc_pago);
request.fa_f_emision_pago=datetoString(c_facturas.f_emision_pago);
request.fa_cod_localidad=StringClip(false,c_facturas.cod_localidad);
request.fa_cod_banco=StringClip(true,c_facturas.cod_banco);
request.fa_importe_total=NroFormat(c_facturas.importe_total,NF11);
request.fa_nro_reg_vto=StringClip(false,c_facturas.nro_reg_vto);
request.fa_vto_pago=datetoString(c_facturas.vto_pago);
request.fa_is_locked=StringClip(false,c_facturas.is_locked);
if (request.fa_cod_centro && request.fa_cod_centro != null && clave != "=") {
CursorTabla("ce","cod_centro","=\'"+StringClip(true,request.fa_cod_centro)+"\'",false,false);
request.fa_t_des_centro=c_centros.descripcion;
c_centros.close();
}
else
request.fa_t_des_centro="";
if (request.fa_cod_banco && request.fa_cod_banco != null && clave != "=") {
CursorTabla("ba","cod_banco","=\'"+StringClip(true,request.fa_cod_banco)+"\'",false,false);
request.fa_t_nombre_banco=c_bancos.nombre;
c_bancos.close();
}
else
request.fa_t_nombre_banco="";
if (request.fa_nif && request.fa_nif != null && clave != "=") {
CursorTabla("pr","nif","=\'"+StringClip(true,request.fa_nif)+"\'",false,false);
request.fa_t_razon_social=StringClip(false,c_proveedores.razon_social);
if ( request.fa_t_razon_social == " " ) {
request.fa_t_razon_social="NO EXISTE";
request.fa_cta_contable="";
}
else {
request.fa_cta_contable=StringClip(false,c_proveedores.cta_contable);
}
c_proveedores.close();
}
else {
request.fa_t_razon_social="";
request.fa_cta_contable="";
}
}
writeln('<FORM NAME="f_factura" METHOD="post"');
if (request.fa_nro_reg && !request.nvo)
htmlpath="o_vto.html?fa_nro_reg="+escape(request.fa_nro_reg)+"&"+baseHtml;
else if (request.fa_nro_reg && request.nvo)
htmlpath="o_vto.html?nvo=1&"+baseHtml;
else
htmlpath="o_vto.html?nvo=1&cookie=1&lock=true&"+baseHtml;
writeln('action="'+htmlpath+'"');
writeln(' onSubmit="return Chek_fields(this)">');
LoadHidden(htmlpath);
if (!request.waux && request.FrameType == "L" )
ObjHeadBar(request.fa_nro_reg,"Vencimientos","vt_");
writeln('<FONT SIZE=2>');
writeln('<CENTER><TABLE BORDER=0 ALIGN=CENTER><TR>');
if (request.fa_nro_reg && request.fa_nro_reg.length > 1 ) {
writeln('<TR><TD ALIGN=LEFT><B>Remesa.Vto.</B></TD>');
if (request.waux || !request.lock) {
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.fa_nro_remesan+'/'+request.fa_nro_remesay+'</B></FONT><INPUT type="hidden" name="fa_nro_remesa" VALUE="'+request.fa_nro_remesa+'"></TD></FONT>');
writeln('<INPUT type="hidden" name="fa_nro_remesan" VALUE="'+request.fa_nro_remesan+'">');
writeln('<INPUT type="hidden" name="fa_nro_remesay" VALUE="'+request.fa_nro_remesay+'">');
} else {
writeln('<TD ALIGN=RIGHT><INPUT TYPE="text" NAME="fa_nro_remesan" VALUE="'+request.fa_nro_remesan+'" SIZE=5 OnChange="setNroReg(this)">');
writeln('<INPUT TYPE="text" NAME="fa_nro_remesay" VALUE="'+request.fa_nro_remesay+'" SIZE=4 OnChange="chkYearNroReg(this);setNroReg(this)">');
writeln('<INPUT type="hidden" NAME="fa_nro_remesa" VALUE="'+request.fa_nro_remesa+'"></TD></FONT>');
}
}
writeln('<TR><TD ALIGN=LEFT><B>Nro. Doc. Pago</B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.fa_nro_doc_pago+'</FONT><INPUT type="hidden" name="fa_nro_doc_pago" VALUE="'+request.fa_nro_doc_pago+'" size=8 maxlength=8></FONT></TD></TR>');
else {
writeln('<TD ALIGN=RIGHT><INPUT type="text" name="fa_nro_doc_pago" VALUE="'+request.fa_nro_doc_pago+'" size=12 maxlength=12></TD>');
// writeln('<TD><INPUT TYPE="button" VALUE="Ver" NAME="ver" ONCLICK="FormPaint(this)"></TD>');
}
writeln('</TR></TABLE></CENTER>');
if (request.fa_nro_reg && request.fa_nro_reg.length > 1 ) {
writeln('<CENTER><TABLE BORDER=1 ALIGN=CENTER><TR>');
writeln('<TR><TD ALIGN=RIGHT><INPUT TYPE="button" VALUE=" N.I.F. " ONCLICK="w_auxiliar(\'proveedor\',\'Proveedores\',\'pr_nif\',\''+StringClip(true,request.fa_nif)+'\')">');
writeln('<FONT COLOR="#800040"><B>'+request.fa_nif+'</B></FONT><INPUT type="hidden" name="fa_nif" VALUE="'+request.fa_nif+'"></TD>');
if (request.fa_t_razon_social == "NO EXISTE")
writeln('<TD ALIGN=LEFT><BLINK><FONT COLOR="#800040">'+request.fa_t_razon_social+'</FONT></BLINK>');
else
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.fa_t_razon_social+'</FONT>');
writeln('<INPUT type="hidden" name="fa_t_razon_social" VALUE="'+request.fa_t_razon_social+'">');
writeln('<INPUT type="hidden" name="fa_cta_contable" VALUE="'+request.fa_cta_contable+'"></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><INPUT TYPE="button" VALUE="Centro" ONCLICK="w_auxiliar(\'centro\',\'Centros\',\'ce_cod_centro\',\''+StringClip(true,request.fa_cod_centro)+'\')">');
writeln('<FONT COLOR="#800040"><B>'+request.fa_cod_centro+'</B></FONT><INPUT TYPE="hidden" NAME="fa_cod_centro" VALUE="'+request.fa_cod_centro+'" SIZE=12 OnChange="RePaint(this)"> </TD>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.fa_t_des_centro+'</FONT></TD>');
writeln('<TR><TD ALIGN=RIGHT><B> Banco: </B>');
writeln('<FONT COLOR="#800040"><B>'+request.fa_cod_banco+'</B></FONT><INPUT TYPE="hidden" NAME="fa_cod_banco" VALUE="'+request.fa_cod_banco+'" SIZE=4 OnChange="RePaint(this)"> </TD>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.fa_t_nombre_banco+'</FONT></TD>');
writeln('<TR><TD ALIGN=RIGHT><B>Localidad:</B></TD><TD>');
writeln('<FONT COLOR="#800040"><B>'+request.fa_cod_localidad+'</FONT><INPUT type="hidden" name="fa_cod_localidad" VALUE="'+request.fa_cod_localidad+'" size=12 maxlength=12></FONT></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B>Fecha Emisión:</B></TD><TD>');
writeln('<FONT COLOR="#800040"><B>'+request.fa_f_emision_pago+'</FONT><INPUT type="hidden" name="fa_f_emision_pago" VALUE="'+request.fa_f_emision_pago+'" size=8 maxlength=8></TD></FONT></TR>');
writeln('<TR><TD ALIGN=RIGHT><B>Vencimiento:</B></TD><TD>');
writeln('<FONT COLOR="#800040"><B>'+request.fa_vto_pago+'</FONT><INPUT type="hidden" name="fa_vto_pago" VALUE="'+request.fa_vto_pago+'" size=8 maxlength=8></TD></FONT></TR>');
writeln('</TR></TABLE></CENTER>');
writeln('<CENTER><TABLE BORDER=1 ALIGN=CENTER><TR>');
// Sumamos las facturas ...
writeln("<TR><TD>Nro. Reg. </TD><TD ALIGN=CENTER>" +
"Nro.Fra</TD><TD ALIGN=CENTER>Importe" +
"</A><BR></TD></TR>");
request.SumaTotal=0;
while (true && c_facturas.nro_reg.length > 0) {
writeln("<TR><TD>"+
"<INPUT TYPE='button' VALUE='"+c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4)+"' ONCLICK='w_auxiliar(\"factura\",\"Facturas\",\"fa_nro_reg\",\""+StringClip(true,c_facturas.nro_reg)+"\")' >" +
"</TD><TD ALIGN=RIGHT>" +
StringClip(true,c_facturas.nro_fra) + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF11) +
"</A><BR></TD></TR>");
request.SumaTotal=parseFloat(c_facturas.importe_total)+parseFloat(request.SumaTotal)
if (!c_facturas.next())
break;
}
c_facturas.close();
writeln("<TR><TD><FONT COLOR='#800040'><B>TOTAL .... </TD></FONT><TD ALIGN=RIGHT><FONT COLOR='#800040'><B>" +
"................. </FONT></TD><TD ALIGN=RIGHT><FONT COLOR='#800040'><B>" +
NroFormat(request.SumaTotal,NF11) +
"<FONT><BR></TD></TR>");
writeln('</TR></TABLE></CENTER>');
}
</SERVER>
</FORM></FONT>
<SERVER>
if (!request.waux) {
writeSignature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

459
o_vtos.html Normal file
View File

@ -0,0 +1,459 @@
<TITLE>Factura</TITLE>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>facturas</TITLE>
<META NAME="GENERATOR" CONTENT="AdmiSys Sistemas informáticos">
<META NAME="Author" CONTENT="WebTeam">
<META NAME="Organization" CONTENT="AdmiSys S.L.">
<META NAME="Document description" CONTENT="Alta y Modificación de facturas Internos">
<META NAME="Last modified date" CONTENT="Thursday, February 06, 1997 07:33:31">
</HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<SERVER>
// Variables para el Server
var HOY=new Date();
var entorno = new entObj(0);
var NF11=""
var baseHtml="";
var whitespace="";
dbAcl();
//if ((!request.waux && request.lock) || request.nvo )
LoadParametros();
writeln("<SCRIPT LANGUAGE='JavaScript'>");
//if ((!request.waux && request.lock) || request.nvo )
SetParametros();
writeln(' function setNroReg(obj) {');
writeln(' document.f_factura.fa_nro_remesa.value=StringClip(true,document.f_factura.fa_nro_remesay.value)+StringClip(true,document.f_factura.fa_nro_remesan.value);');
writeln(' }');
writeln(' function chkYearNroReg(obj) {');
writeln(' var nro=0;');
writeln(' nro=parseInt(obj.value); ');
writeln(' obj.value=nro; ');
writeln(' if ( HOY.getFullYear() != nro ) ');
writeln(' alert("¡¡ El Año del Nro. de Registro no es el actual !! ");');
writeln(' }');
writeln('function FormPaint(obj) {');
writeln(' document.f_factura.action=document.f_factura.htmlBaseRef.value+"&cookie=1&lock=true"');
writeln(' document.f_factura.submit();');
writeln(' } ');
writeln(' function GoField() {');
writeln(' var f=document.f_factura; ');
if ( request.prt) {
var nremesay=""+request.prt.substring(0,4);
var nremesan=""+request.prt.substring(4,10);
writeln(' alert("\\rNro. Registro Vto: '+nremesan+'/'+nremesay+' Actualizado.\\r"); ');
}
if (request.exec=="add" || request.exec == "upd" )
writeln(' f.submit(); ');
writeln(' f.fa_nro_doc_pago.focus();');
writeln(' }');
writeln(' function Chek_fields(obj) {');
if (request.waux || !request.lock)
writeln(' return true;');
else {
writeln(' if ( emptyField(obj.fa_nro_doc_pago) == true ) { ');
writeln(' alert("!!! Es necesario rellenar el Nro. de documento de Pago !!!->"+obj.fa_nro_doc_pago.value+"<-");');
writeln(' return false;');
writeln(' };');
writeln(' return true;');
}
writeln(' }');
if ( request.FrameType == "F" || request.FrameType == "T" ) {
writeln('function RunFunction(obj,valor,clave,f_nro) {');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var f_form=mainFrame.document.f_factura;');
writeln(' if ( obj == "Ayuda" ) {');
writeln(' NetHelp(valor);');
writeln(' }');
writeln(' history.back();');
writeln('}');
writeln('function WriteFrameButtons() {')
if (!request.waux) {
writeln(' var topFrame=find_frame(top,"top");');
writeln(' var ndoc=topFrame.document; ');
writeln(' var mainFrame=find_frame(top,"main");');
writeln(' var formAction=document.f_factura.htmlBaseRef.value;');
ObjButtons(request.fa_nro_reg,"Facturas","fa_");
}
writeln('}');
}
if ( request.ViewFkey == "S" ) {
writeln('function RePaint(obj) {');
writeln(' for ( var i=0; i < document.f_factura.length; i++ ) { ');
writeln(' if ( document.f_factura.elements[i].name == obj.name ) ');
writeln(' break; ');
writeln(' } ');
writeln(' document.f_factura.action=document.f_factura.htmlBaseRef.value+"&cookie=1&nro="+nl+"&lock=true"');
writeln(' document.f_factura.submit();');
writeln('} ');
}
else {
writeln('function ScrollVer(obj) {');
writeln(' status_scroll=true; ');
writeln(' MESSAGE=" ¡¡¡ Usar el botón de \'Ver\' para "+ ');
writeln(' " actualizar los valores de la Base de Datos desde el Servidor !!! " ');
writeln(' scroll = new statusMessageObject(); ');
writeln(' scroller(); ');
writeln('} ');
writeln('function RePaint(obj) {');
writeln(' if (status_scroll != true ) ');
writeln(' ScrollVer(obj); ');
writeln('} ');
}
writeln("</SCRIPT>");
if (request.gofunc)
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\',\''+request.nvo+'\','+request.nro+')"');
else {
if ( request.FrameType == "F" || request.FrameType == "T" )
writeln(' <BODY OnLoad="WriteFrameButtons(); GoField();//SumaLineas(this)"');
else
writeln('<BODY OnLoad="GoField();//SumaLineas(this)" ');
}
writeln(' BACKGROUND="images/backgrnd.gif">');
if (request.gofunc) {
writeln(' </BODY>');
writeln(' </HTML>');
writeln(' <!--');
}
if (!request.cookie && !request.gofunc) {
dbConnect();
// Vemos que tarea hay que ejecutar:
if (request.add) {
client.is_trans=true;
database.beginTransaction();
if ( request.fa_nro_remesan == "+" ) {
c_parametros=database.cursor("SELECT nro_remesa FROM parametros WHERE id='1'");
status=c_parametros.next();
var nro_remesa=StringClip(false,c_parametros.nro_remesa);
var lon=nro_remesa.length;
if ( lon > 4 ) {
var updParams=true;
var nroremesan=parseFloat(c_parametros.nro_remesa.substring(4,lon))+1;
request.nro_remesan=NroFormat(nroremesan,"00000");
request.nro_remesay=c_parametros.nro_remesa.substring(0,4);
}
else {
var updParams=true;
request.nro_remesay="";
request.nroremesan=parseInt(nro_remesa)+1;
request.nro_remesan=NroFormat(request.nroremesan,"00000");
}
project.lock();
}
else {
var updParams=false;
request.nro_remesan=request.fa_nro_remesan;
request.nro_remesay=request.fa_nro_remesay;
}
request.fa_nro_remesa=request.nro_remesay+request.nro_remesan;
status=database.execute("UPDATE parametros SET "+
" nro_remesa='" +request.fa_nro_remesa + "'"+
" WHERE id = '1'" );
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
project.unlock();
redirect(addClient('error.html?alert=8'));
}
DbsError(true,status);
if ( updParams == true ) {
status=database.execute("UPDATE facturas SET "+
" nro_reg_vto='" + StringClip(true,request.fa_nro_remesa) + "'"+
" WHERE nro_doc_pago = '" + request.fa_nro_doc_pago + "'" );
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect(addClient('error.html'));
}
}
database.commitTransaction();
client.is_trans=false;
if ( updParams == true )
project.unlock();
redirect(addClient("o_vtos.html?nvo=1&prt="+request.fa_nro_remesa+"&"+baseHtml+"&treq="+escape(textoReqs)));
}
//Ejecuta una actualización de la fila sobre la fila actual ...
if (request.upd && request.fa_nro_reg) {
if (request.lock)
client.is_trans=true;
database.beginTransaction();
status=database.execute("UPDATE facturas SET "+
" nro_reg_vto='" + StringClip(true,request.fa_nro_remesa) + "'"+
" WHERE nro_doc_pago = '" + request.fa_nro_doc_pago + "'" );
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect(addClient('error.html?alert=9'));
}
DbsError(true,status);
DelFraLins();
InsFraLins();
database.commitTransaction();
client.is_trans=false;
redirect(addClient("g_vtos.html?prt="+request.fa_nro_remesa+"&"+baseHtml));
}
//Ejecuta un borrado de la fila actual ...
if (request.del) {
client.is_trans=true;
database.beginTransaction();
status=database.execute("UPDATE facturas SET "+
" nro_reg_vto=''"+
" WHERE nro_doc_pago = '" + request.fa_nro_doc_pago + "'" );
if ( status != 0 ) {
client.is_trans=false;
database.rollbackTransaction();
redirect(addClient('error.html?alert=10'));
}
DbsError(true,status);
DelFraLins();
database.commitTransaction();
client.is_trans=false;
redirect(addClient("g_vtos.html?"+baseHtml));
}
if (request.fa_nro_reg && !request.upd && !request.add ) {
// Si hay Clave de la tabla seleccionamos los datos ....
//Si se busca la fila ... usando la clave primaria de la relación
if (request.lock) {
client.is_trans=true;
database.beginTransaction();
CursorTabla("fa","nro_reg","=\'"+request.fa_nro_reg+"\'",true,true);
}
else
CursorTabla("fa","nro_reg","=\'"+request.fa_nro_reg+"\'",true,"");
// Asignamos a request todas las columnas necesarias para el form.
request.fa_nro_remesa=StringClip(false,c_facturas.nro_reg_vto);
var lon=request.fa_nro_remesa.length;
request.fa_nro_remesan=request.fa_nro_remesa.substring(4,lon);
request.fa_nro_remesay=request.fa_nro_remesa.substring(0,4);
request.fa_nro_reg=StringClip(false,c_facturas.nro_reg);
var lon=request.fa_nro_reg.length;
request.fa_nro_regn=request.fa_nro_reg.substring(4,lon);
request.fa_nro_regy=request.fa_nro_reg.substring(0,4);
request.fa_nro_fra=StringClip(false,c_facturas.nro_fra);
request.fa_nif=StringClip(false,c_facturas.nif);
request.fa_cod_centro=StringClip(false,c_facturas.cod_centro);
request.fa_nro_doc_pago=StringClip(true,c_facturas.nro_doc_pago);
request.fa_f_emision_pago=datetoString(c_facturas.f_emision_pago);
request.fa_cod_localidad=StringClip(false,c_facturas.cod_localidad);
request.fa_cod_banco=StringClip(true,c_facturas.cod_banco);
request.fa_importe_total=NroFormat(c_facturas.importe_total,NF11);
request.fa_nro_reg_vto=StringClip(false,c_facturas.nro_reg_vto);
request.fa_vto_pago=datetoString(c_facturas.vto_pago);
request.fa_is_locked=StringClip(false,c_facturas.is_locked);
if (request.lock)
c_facturas.close();
// if (request.fa_is_locked == "S" )
// request.waux=8;
if (request.fa_cod_centro && request.fa_cod_centro != null) {
CursorTabla("ce","cod_centro","=\'"+StringClip(true,request.fa_cod_centro)+"\'",false,false);
request.fa_t_des_centro=c_centros.descripcion;
c_centros.close();
}
else
request.fa_t_des_centro="";
if (request.fa_nif && request.fa_nif != null ) {
CursorTabla("pr","nif","=\'"+StringClip(true,request.fa_nif)+"\'",false,false);
request.fa_t_razon_social=StringClip(false,c_proveedores.razon_social);
if ( request.fa_t_razon_social == " " ) {
request.fa_t_razon_social="NO EXISTE";
request.fa_cta_contable="";
}
else {
request.fa_cta_contable=StringClip(false,c_proveedores.cta_contable);
}
c_proveedores.close();
}
else {
request.fa_t_razon_social="";
request.fa_cta_contable="";
}
if (request.fa_cod_banco && request.fa_cod_banco != null) {
CursorTabla("ba","cod_banco","=\'"+StringClip(true,request.fa_cod_banco)+"\'",false,false);
request.fa_t_nombre_banco=c_bancos.nombre;
c_bancos.close();
}
else
request.fa_t_nombre_banco="";
}
else {
// Estos son los Defaults Reales del Form ... Aquí pueden cambiarse ...
IniciaRequest("fa_");
var n = HOY.getYear();
if ( n >= 0 && n <= 70 )
n += 2000;
else
n += 1900;
request.fa_nro_remesan="+";
request.fa_nro_remesay=n;
request.fa_nro_remesa="+"+n
request.fa_nro_reg="";
request.lock=true;
request.fa_t_razon_social="";
request.fa_cta_contable="";
request.fa_t_des_centro="";
request.fa_t_nombre_banco="";
request.fa_t_condpago="";
request.fa_cp_vto=0;
request.fa_importe_total=0;
}
}
else if (!request.gofunc) {
// Se entiende que request contiene todas las columnas necesarias para el form.
// y que esta llamada es para leer y cargar las claves foráneas de la tabla.
if (request.fa_nro_doc_pago && !request.upd && !request.add ) {
// Si hay Clave de la tabla seleccionamos los datos ....
//Si se busca la fila ... usando la clave primaria de la relación
CursorTabla("fa","nro_doc_pago","=\'"+request.fa_nro_doc_pago+"\'",true,"");
}
// Asignamos a request todas las columnas necesarias para el form.
request.fa_nro_remesa=StringClip(false,c_facturas.nro_reg_vto);
var lon=request.fa_nro_remesa.length;
request.fa_nro_remesan=request.fa_nro_remesa.substring(4,lon);
request.fa_nro_remesay=request.fa_nro_remesa.substring(0,4);
request.fa_nro_reg=StringClip(false,c_facturas.nro_reg);
var lon=request.fa_nro_reg.length;
request.fa_nro_regn=request.fa_nro_reg.substring(4,lon);
request.fa_nro_regy=request.fa_nro_reg.substring(0,4);
request.fa_nro_fra=StringClip(false,c_facturas.nro_fra);
request.fa_nif=StringClip(false,c_facturas.nif);
request.fa_cod_centro=StringClip(false,c_facturas.cod_centro);
request.fa_nro_doc_pago=StringClip(true,c_facturas.nro_doc_pago);
request.fa_f_emision_pago=datetoString(c_facturas.f_emision_pago);
request.fa_cod_localidad=StringClip(false,c_facturas.cod_localidad);
request.fa_cod_banco=StringClip(true,c_facturas.cod_banco);
request.fa_importe_total=NroFormat(c_facturas.importe_total,NF11);
request.fa_nro_reg_vto=StringClip(false,c_facturas.nro_reg_vto);
request.fa_vto_pago=datetoString(c_facturas.vto_pago);
request.fa_is_locked=StringClip(false,c_facturas.is_locked);
if (request.fa_cod_centro && request.fa_cod_centro != null) {
CursorTabla("ce","cod_centro","=\'"+StringClip(true,request.fa_cod_centro)+"\'",false,false);
request.fa_t_des_centro=c_centros.descripcion;
c_centros.close();
}
else
request.fa_t_des_centro="";
if (request.fa_cod_banco && request.fa_cod_banco != null) {
CursorTabla("ba","cod_banco","=\'"+StringClip(true,request.fa_cod_banco)+"\'",false,false);
request.fa_t_nombre_banco=c_bancos.nombre;
c_bancos.close();
}
else
request.fa_t_nombre_banco="";
if (request.fa_nif && request.fa_nif != null ) {
CursorTabla("pr","nif","=\'"+StringClip(true,request.fa_nif)+"\'",false,false);
request.fa_t_razon_social=StringClip(false,c_proveedores.razon_social);
if ( request.fa_t_razon_social == " " ) {
request.fa_t_razon_social="NO EXISTE";
request.fa_cta_contable="";
}
else {
request.fa_cta_contable=StringClip(false,c_proveedores.cta_contable);
}
c_proveedores.close();
}
else {
request.fa_t_razon_social="";
request.fa_cta_contable="";
}
}
writeln('<FORM NAME="f_factura" METHOD="post"');
if (request.fa_nro_reg && !request.nvo)
htmlpath="o_vtos.html?fa_nro_reg="+escape(request.fa_nro_reg)+"&"+baseHtml;
else
htmlpath="o_vtos.html?nvo=1&"+baseHtml;
writeln('action="'+htmlpath+'"');
writeln(' onSubmit="return Chek_fields(this)">');
LoadHidden(htmlpath);
if (!request.waux && request.FrameType == "L" )
ObjHeadBar(request.fa_nro_reg,"Vencimientos","vt_");
writeln('<FONT SIZE=2>');
writeln('<CENTER><TABLE BORDER=0 ALIGN=CENTER><TR>');
writeln('<TR><TD ALIGN=LEFT><B>Remesa.Vto.</B></TD>');
if (request.waux || !request.lock) {
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.fa_nro_remesan+'/'+request.fa_nro_remesay+'</B></FONT><INPUT type="hidden" name="fa_nro_remesa" VALUE="'+request.fa_nro_remesa+'"></TD></FONT>');
writeln('<INPUT type="hidden" name="fa_nro_remesan" VALUE="'+request.fa_nro_remesan+'">');
writeln('<INPUT type="hidden" name="fa_nro_remesay" VALUE="'+request.fa_nro_remesay+'">');
}
else {
writeln('<TD ALIGN=RIGHT><INPUT TYPE="text" NAME="fa_nro_remesan" VALUE="'+request.fa_nro_remesan+'" SIZE=5 OnChange="setNroReg(this)">');
writeln('<INPUT TYPE="text" NAME="fa_nro_remesay" VALUE="'+request.fa_nro_remesay+'" SIZE=4 OnChange="chkYearNroReg(this);setNroReg(this)">');
writeln('<INPUT type="hidden" NAME="fa_nro_remesa" VALUE="'+request.fa_nro_remesa+'"></TD></FONT>');
}
writeln('<TR><TD ALIGN=LEFT><B>Nro. Doc. Pago</B></TD>');
if (request.waux || !request.lock)
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.fa_nro_doc_pago+'</FONT><INPUT type="hidden" name="fa_nro_doc_pago" VALUE="'+request.fa_nro_doc_pago+'" size=8 maxlength=8></FONT></TD></TR>');
else {
writeln('<TD ALIGN=RIGHT><INPUT type="text" name="fa_nro_doc_pago" VALUE="'+request.fa_nro_doc_pago+'" size=12 maxlength=12></TD>');
writeln('<TD><INPUT TYPE="button" VALUE="Ver" NAME="ver" ONCLICK="FormPaint(this)"></TD>');
}
writeln('</TR></TABLE></CENTER>');
if (request.fa_nro_reg ) {
writeln('<CENTER><TABLE BORDER=1 ALIGN=CENTER><TR>');
writeln('<TR><TD ALIGN=RIGHT><INPUT TYPE="button" VALUE=" N.I.F. " ONCLICK="w_auxiliar(\'proveedor\',\'Proveedores\',\'pr_nif\',\''+StringClip(true,request.fa_nif)+'\')">');
writeln('<FONT COLOR="#800040"><B>'+request.fa_nif+'</B></FONT><INPUT type="hidden" name="fa_nif" VALUE="'+request.fa_nif+'"></TD>');
if (request.fa_t_razon_social == "NO EXISTE")
writeln('<TD ALIGN=LEFT><BLINK><FONT COLOR="#800040">'+request.fa_t_razon_social+'</FONT></BLINK>');
else
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.fa_t_razon_social+'</FONT>');
writeln('<INPUT type="hidden" name="fa_t_razon_social" VALUE="'+request.fa_t_razon_social+'">');
writeln('<INPUT type="hidden" name="fa_cta_contable" VALUE="'+request.fa_cta_contable+'"></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><INPUT TYPE="button" VALUE="Centro" ONCLICK="w_auxiliar(\'centro\',\'Centros\',\'ce_cod_centro\',\''+StringClip(true,request.fa_cod_centro)+'\')">');
writeln('<FONT COLOR="#800040"><B>'+request.fa_cod_centro+'</B></FONT><INPUT TYPE="hidden" NAME="fa_cod_centro" VALUE="'+request.fa_cod_centro+'" SIZE=12 OnChange="RePaint(this)"> </TD>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.fa_t_des_centro+'</FONT></TD>');
writeln('<TR><TD ALIGN=RIGHT><B> Banco: </B>');
writeln('<FONT COLOR="#800040"><B>'+request.fa_cod_banco+'</B></FONT><INPUT TYPE="hidden" NAME="fa_cod_banco" VALUE="'+request.fa_cod_banco+'" SIZE=4 OnChange="RePaint(this)"> </TD>');
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.fa_t_nombre_banco+'</FONT></TD>');
writeln('<TR><TD ALIGN=RIGHT><B>Localidad:</B></TD><TD>');
writeln('<FONT COLOR="#800040"><B>'+request.fa_cod_localidad+'</FONT><INPUT type="hidden" name="fa_cod_localidad" VALUE="'+request.fa_cod_localidad+'" size=12 maxlength=12></FONT></TD></TR>');
writeln('<TR><TD ALIGN=RIGHT><B>Fecha Emisión:</B></TD><TD>');
writeln('<FONT COLOR="#800040"><B>'+request.fa_f_emision_pago+'</FONT><INPUT type="hidden" name="fa_f_emision_pago" VALUE="'+request.fa_f_emision_pago+'" size=8 maxlength=8></TD></FONT></TR>');
writeln('<TR><TD ALIGN=RIGHT><B>Vencimiento:</B></TD><TD>');
writeln('<FONT COLOR="#800040"><B>'+request.fa_vto_pago+'</FONT><INPUT type="hidden" name="fa_vto_pago" VALUE="'+request.fa_vto_pago+'" size=8 maxlength=8></TD></FONT></TR>');
writeln('</TR></TABLE></CENTER>');
writeln('<CENTER><TABLE BORDER=1 ALIGN=CENTER><TR>');
// Sumamos las facturas ...
writeln("<TR><TD>Nro. Reg. </TD><TD ALIGN=CENTER>" +
"Nro.Fra</TD><TD ALIGN=CENTER>Importe" +
"</A><BR></TD></TR>");
request.SumaTotal=0;
while (true && c_facturas.nro_reg.length > 0) {
writeln("<TR><TD>"+
"<INPUT TYPE='button' VALUE='"+c_facturas.nro_reg.substring(4,c_facturas.nro_reg.length) + "/" +
c_facturas.nro_reg.substring(0,4)+"' ONCLICK='w_auxiliar(\"factura\",\"Facturas\",\"fa_nro_reg\",\""+StringClip(true,request.fa_nro_reg)+"\")' >" +
"</TD><TD ALIGN=RIGHT>" +
StringClip(true,c_facturas.nro_fra) + "</TD><TD ALIGN=RIGHT>" +
NroFormat(c_facturas.importe_total,NF11) +
"</A><BR></TD></TR>");
request.SumaTotal=parseFloat(c_facturas.importe_total)+parseFloat(request.SumaTotal)
if (!c_facturas.next())
break;
}
c_facturas.close();
writeln("<TR><TD><FONT COLOR='#800040'><B>TOTAL .... </TD></FONT><TD ALIGN=RIGHT><FONT COLOR='#800040'><B>" +
"................. </FONT></TD><TD ALIGN=RIGHT><FONT COLOR='#800040'><B>" +
NroFormat(request.SumaTotal,NF11) +
"<FONT><BR></TD></TR>");
writeln('</TR></TABLE></CENTER>');
}
</SERVER>
</FORM></FONT>
<SERVER>
if (!request.waux) {
writeSignature(true);
}
if (request.gofunc) {
writeln('-->');
}
else {
writeln('</BODY>');
writeln('</HTML>');
}
</SERVER>

19
obras.html Normal file
View File

@ -0,0 +1,19 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Página en Obras</TITLE>
<META NAME="Author" CONTENT="">
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (Win95; I) [Netscape]">
</HEAD>
<BODY BACKGROUND="images/backgrnd.gif">
<H1><IMG SRC="images/SGRP.jpg" BORDER=2 HEIGHT=76 WIDTH=86></H1>
<H1 ALIGN=CENTER><FONT COLOR="#FF0000"><FONT SIZE=+4>P&aacute;gina en Construcci&oacute;n
</FONT></FONT></H1>
<CENTER><P><A HREF="obras.html"></A>
<IMG SRC="images/obra.gif" HEIGHT=174 WIDTH=222></P></CENTER>
</BODY>
</HTML>

127
reinitial.html Normal file
View File

@ -0,0 +1,127 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Inicio</TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/4.0b1 (Win95; I) [Netscape]">
<SCRIPT language="JavaScript">
function validate() {
if (!document.login.username.value) {
alert("Debe introducir un nombre de usuario y una clave de acceso!");
return false;
}
document.login.prevPage.value = "initial.html submit";
return true;
}
</SCRIPT>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
</HEAD>
<BODY BACKGROUND="images/BG.JPG">
<P><!-- application: Cuentas a Pagar -->
<!-- version: 1.0 -->
<!-- company name: AdmiSys -->
<!-- filename: initial.html -->
<!-- description: initial and default page of the application -->
<!-- application returns here whenever a non-database -->
<!-- error occurs. checks if user is logged in, -->
<!-- prompts for id and password if not, else goes to -->
<!-- main application screen. -->
<SERVER>
/*
$Log: initial.html,v $
*/
<!-- this is the only page where client.prevPage doesn't matter -->
client.prevPage = "rinitial.html";
client.es_inicio = 1;
dbConnect();
<!-- if we know who the user is already, go direct to enter hours -->
if (!request.ipw && client.username != "null" && client.username != null) {
// if (!loggedIn()) <!-- session expired -->
// redirect("logout.html");
// else
// if (request.err)
// redirect("multi_entry.html");
// else
redirect("ctasapagar.html?FrameType="+request.FrameType);
}
if (request.err)
redirect("logged_out.html");
</SERVER></P>
<DIV ALIGN=CENTER><TABLE BORDER=4 BGCOLOR="#FFFFFF" >
<TR><TD COLSPAN="3">
<DT><A HREF="http://ctasapagar"><IMG SRC="images/sand2new.gif"
ALT="Construcciones SANDO" BORDER=0 HEIGHT=117 WIDTH=424 ALIGN=RIGHT></A>
<A HREF="http://ctasapagar">&nbsp;</A></DT>
</TD></TR>
</TABLE>
<H1>
Departamento de Cuentas a Pagar
</A></H1>
<TABLE>
<CAPTION>
<P><!------ end nested table --></P></RIGHT>
</CAPTION>
<TR><TD><DT>&nbsp;</DT></TD>
<TD colspan=2 align=right><DT>
<FORM name="login"
method="post"
action="login.html"
onSubmit="return validate()">
</DT>
<P><!----- nested table -------></P>
<TR valign=baseline><TD><DT>
<SERVER>
<!-- if request.ipw is set, the user has entered an incorrect login -->
<!-- or password. -->
if (request.ipw) {
writeln("<td><b><i>El nombre de usuario o el password<br>es incorrecto.</i></b></td>");
}
</SERVER>
</DT>
</TD><DT></DT>
<TD align=right><H3>USER</H3></TD>
<TD><DT>
<SERVER>
if (request.username != "null" && request.username != null)
writeln(" <input name=\"username\" type=\"hidden\" size=\"15\" value=\""+request.username+"\">");
else
writeln(" <input name=\"username\" type=\"text\" size=\"15\">");
</SERVER>
</DT></TD></TR>
<TR valign=baseline><TD><DT>
<SERVER>
if (request.ipw)
writeln("<td><b><i>Por favor Intentar otra vez.</i></b></td>");
</SERVER>
</DT></TD>
<TD align=right><H3>PASSWORD</H3></TD>
<TD><DT><INPUT name="password" type="password" size="15"></DT></TD></TR>
<TR><TD><DT>
<SERVER>
if (request.ipw)
writeln("<td></td>");
</SERVER>
</DT></TD>
<TD><DT>&nbsp;</DT></TD>
<TD align=right><DT>
<INPUT name="Submit" type="submit" value="ENTER">
<INPUT name="prevPage" type="hidden"></DT>
</TD>
</TR>
</TABLE></DIV>
<SERVER>
writeln('<INPUT TYPE="hidden" NAME="FrameType" VALUE="'+request.FrameType+'" >');
writeln('<INPUT TYPE="hidden" NAME="ViewFkey" VALUE="'+request.ViewFkey+'" >');
writeln('<INPUT TYPE="hidden" NAME="MsgScroll" VALUE="'+request.MsgScroll+'" >');
</SERVER>
</FORM>
<SERVER>writeSignature(true);</SERVER>
<BR><CENTER>Last modified: 27/2/97&nbsp;</FONT></DT></CENTER>
</BODY>
</HTML>

35
w_auxiliar.html Normal file
View File

@ -0,0 +1,35 @@
<html>
<!-- application: Cuentas a Pagar -->
<!-- version: 1.0 -->
<!-- company name: AdmiSys -->
<!-- filename: help.html -->
<!-- description: frameset for online help facility -->
<SCRIPT SRC="global.js" >
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<head>
<SERVER>writeln('<title>Ventana Auxiliar de '+request.titulo+'</title>');</SERVER>
</head>
<script language="JavaScript">
topic = location.hash
</script>
<SERVER>
var baseHtml="FrameType="+request.FrameType+"&ViewFkey="+request.ViewFkey+"&uid="+request.uid
if (!request.obj)
redirect("go_back.html")
if (request.clave && request.valor ) {
// redirect('o_'+ request.obj +'.html?waux=2&'+request.clave+'='+request.valor);
writeln("<frameset rows='52,*'>");
writeln("<frame src='w_auxnavbar.html?waux=2&obj="+request.obj+"&titulo="+request.titulo+"' scrolling=no marginwidth=0 marginheight=0 name='buttons'>");0
writeln('<frame src="o_'+ request.obj +'.html?waux=2&'+request.clave+'='+request.valor +'&'+baseHtml+'">');
}
else {
writeln("<frameset rows='52,*'>");
writeln("<frame src='w_auxnavbar.html?waux=1&obj="+request.obj+"&titulo="+request.titulo+"' scrolling=no marginwidth=0 marginheight=0 name='buttons'>");
writeln('<frame src="g_'+ request.obj +'.html?waux=1&'+baseHtml+'&name="'+ request.obj +'">');
}
</SERVER>
</frameset>
</html>

32
w_auxnavbar.html Normal file
View File

@ -0,0 +1,32 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE></TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (Win95; I) [Netscape]">
</HEAD>
<SCRIPT SRC="global.js">
</SCRIPT>
<SCRIPT SRC="ctasapagar.js">
</SCRIPT>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#003366" VLINK="#333399" ALINK="#FF0000" BACKGROUND="images/backgrnd.gif">
<TABLE WIDTH="100%" >
<SERVER>
writeln('<TR>');
if (request.waux == 1 ) {
writeln('<TD>')
writeln('<A HREF="javascript:parent.frames[1].history.go(-1)"><IMG SRC="images/back1.gif" BORDER=0 HEIGHT=37 WIDTH=44></A>');
writeln('<A HREF="javascript:parent.frames[1].history.go(1)"><IMG SRC="images/forward1.gif" BORDER=0 HEIGHT=37 WIDTH=44></A>');
writeln('</TD>');
writeln('<TD align="center">');
writeln('<H1><FONT SIZE=+3><FONT COLOR="#008000">'+request.titulo+'</FONT><BR></H1></TD>');
}
</SERVER>
<TD align="right" valign="top"><A HREF="javascript:top.close()"><IMG SRC="images/exit1.gif" BORDER=0 HEIGHT=37 WIDTH=44></A>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

24
wrongbrw.html Normal file
View File

@ -0,0 +1,24 @@
<HEAD>
<!-- application: Ctas a Pagar -->
<!-- version: 1.0 -->
<!-- company name: AdmiSys -->
<!-- filename: wrongbrw.html -->
<!-- description: Browser Incorrecto-->
<SCRIPT SRC="global.js">
</SCRIPT>
<!--
<SCRIPT LANGUAGE='JavaScript'>
//function Go_Location() {
alert("\\r ¡¡¡ No es posible utilizar las Páginas con otro Navegador\\r que no sea NETSCAPE NAVIGATOR 3 !!!\\r ");
top.close();
//}
//<BODY ONLOAD="Go_Location()" >
</SCRIPT>
//-->
</HEAD>
</BODY>
</HEAD>
</HTML>