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(' '); writeln(''); writeln(''); writeln("'); 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("'); if ( request.FrameType == "F" || request.FrameType == "T" ) { writeln(""); } if (!request.waux) { if (request.gofunc) { writeln(''); writeln(''); writeln(' '); } else { writeln(''); writeln(''); }