// DO NOT EDIT THIS FILE! see README.TXT - Javascript Compressor 1.1.0
Ext.BLANK_IMAGE_URL='http://www.ceroriesgo.co.cr/scripts/ext-2.1/resources/images/default/s.gif';
String.prototype.lPad=function(n,c){var i;var a=this.split('');for(i=0;i<n-this.length;i++){a.unshift(c);};return a.join('');}
String.prototype.rPad=function(n,c){var i;var a=this.split('');for(i=0;i<n-this.length;i++){a.push(c);};return a.join('');}
function $(){
return window.document.getElementById(arguments[0]);
}
String.prototype.trim=function(){return this.replace(/^\s*|\s*$/g,"");}
var ToastP=null;
var Toast=null;
function addElement(){
var newdiv=document.createElement('div');
newdiv.setAttribute('id','toaster');
document.body.appendChild(newdiv);
}
function ToastAlert(msg){
Ext.onReady(function(){
try{
if(ToastP){
window.setTimeout("ToastP.hide();ToastP=null;",500);
}
}catch(e){}
if(Toast){
Toast.hide();
Toast=null;
window.setTimeout("ToastAlert('"+msg+"')",1000);
return;
}else{
Toast=new Ext.ux.ToastWindow({
title:' Mensaje ....',
id:'Toast',
html:msg,
autoDestroy:true,
closable:true,
width:300,
autoHeight:true,
iconCls:'information'
});
Toast.show(document)
}
});
}
function ToastError(msg){
Ext.onReady(function(){
try{
if(ToastP){
window.setTimeout("ToastP.hide();ToastP=null;",500);
}
}catch(e){}
if(Toast){
Toast.hide();
Toast=null;
window.setTimeout("ToastError(\""+msg+"\")",1000);
return;
}else{
Toast=new Ext.ux.ToastWindow({
title:'Error ....',
id:'Toast',
html:msg,
autoDestroy:true,
closable:true,
width:300,
autoHeight:true,
hideDelay:7000,
iconCls:'error'
});
}
Toast.show(document)
});
}
function showhide(obj,tbl,title){
var d=$(tbl).style.display=="";
var t=$(tbl);
if(d){
t.style.display="none";
}else{
t.style.display="";
}
}
function ToastEnd(){
try{
if(ToastP){
ToastP.hide();
ToastP=null;
}
}catch(e){}
}
function ToastProgress(m){
Ext.onReady(function(){
try{
if(ToastP){
ToastP.hide();
ToastP=null;
window.setTimeout("ToastProgress('"+m+"')",500);
return;
}
}catch(e){}
ToastP=new Ext.ux.ToastWindow({
title:'Progreso ....',
id:'ToastP',
html:m==null?'<img src=\"../img/si/spinner.gif\"></img> Procesando la petición ...':'<img src=\"../img/si/spinner.gif\"></img>'+m,
autoDestroy:false,
closable:false,
height:50,
width:200,
iconCls:'information'
});
ToastP.show(document)
});
}
function Estudios(){
var CantVer=20;
var inicio=false;
this.Solicita=solicita;
this.Listar=listar;
this.Desplazamiento=desplazamientoListar;
this.TodosMarcar=todosMarcar;
this.VPMarcar=vpMarcar;
this.PaqueteMarcar=paqueteMarcar;
this.TipoDocumentoMostrar=tipoDocumentoMostrar;
this.DocumentoMostrar=documentoMostrar;
this.DocumentoBuscar=documentoBuscar;
this.DocumentoFormar=documentoFormar;
this.DocumentoCallBuscar=documentoCallBuscar;
this.EstudioSolicitar=estudioSolicitar;
this.ReferenciasSolicitar=referenciasSolicitar;
this.RCAgregar=rcAgregar;
this.RCEliminar=rcEliminar;
this.RLAgregar=rlAgregar;
this.RLEliminar=rlEliminar;
this.ReferenciasGuardar=referenciasGuardar;
this.Info=info;
this.Ver=ver;
this.EstudioPrepago=estudioprepago;
this.VistaMultiple=vistamultiple;
this.Borrar=borrar;
this.BorrarPoliticas=borrarpoliticas;
this.EstudioRapidoGuardar=estudiorapidoguardar;
this.EstudioPoliticasGuardar=estudiopoliticasguardar;
this.Buscar=buscar;
this.MenuPopit=menupopit;
this.PopitOpcion=popitopcion;
this.CreditScore=creditscore
function popitopcion(){
dojo.io.bind({
url:"../main/paquetexcliente.jsp",
mimetype:"text/json",
method:"GET",
load:function(type,data,event){
if(data.Paquetes[0]!=null){
Paquetes=data.Paquetes;
}
},
error:function(type,errorObject){alert("Error: "+type+"\n"+errorObject.message);}
});
}
function menupopit(obj,P,d){
for(var i=0;i<P.length;i++){
try{
linkset[0]+="<a href=\"javascript:solicita("+P[i].Consecutivo+",'"+d+"');\">"+P[i].Descripcion+"</a>";
}catch(e){}
}
if(linkset[0]=="")
linkset[0]="<b>Opciones ocultas por seguridad</b>";
showmenu(obj,linkset[0]);
}
function buscar(c){
if(c.length>=4){
Ext.get("screenDetailListaEstudios").load({
url:"estudiosbuscar2.jsp",
params:{criterio:c},
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:false,
text:"Cargando ..."
});
}
else
Ext.Msg.alert('Alerta','Criterio de busqueda muy pequeño...');
}
function info(){
window.alert("Solicitar estudios\nCero Riesgo, S.A.");
}
function solicita(){
ToastProgress();
dojo.io.bind({
url:"estudiosolicitar.jsp",
mimetype:"text/html",
method:"GET",
preventCache:"true",
load:function(type,data,event){$("screenDetail").innerHTML=data;paqueteMarcar();ToastEnd();},
error:function(type,errorObject){window.alert("Error: "+type+"\n"+errorObject.message);}
});
}
function listar(){
Ext.get("screenDetailListaEstudios").load({
url:"estudioslistar2.jsp",
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:false,
text:"Cargando ..."
});
}
function desplazamientoListar(desplazamiento){
Ext.get("screenDetailListaEstudios").load({
url:"estudioslistar.jsp",
params:{d:desplazamiento},
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:false,
text:"Cargando ..."
});
}
function paqueteMarcar(paq){
var p=document.getElementsByName("radPaquete");
var pref=false;
if(paq)
pref=true
if(p!=null){
var marca=false;
for(var i=0;i<p.length;i++){
if(!p[i].disabled)
if(!marca){
if(pref){
if(p[i].value==paq){
p[i].click();
marca=true;
}
}else{
p[i].click();
marca=true;
}
}
}
}
}
function todosMarcar(b){
var chks=document.getElementsByName("chkEstudio");
for(i=0;i<chks.length;i++)chks[i].checked=b;
}
function vpMarcar(b){
var chkEstudios=document.getElementsByName("chkEstudio");
var chkVistos=document.getElementsByName("chkVisto");
todosMarcar(false);
for(i=0;i<chkVistos.length;i++){
if(chkVistos[i].checked&&b)
chkEstudios[i].checked=true;
else if(!chkVistos[i].checked&&!b)
chkEstudios[i].checked=true;
}
}
function tipoDocumentoMostrar(paquete){
Ext.getCmp("divBusqueda").load({
url:"busquedasxpaquetes.jsp",
params:{Paquete:paquete},
scripts:true,
callback:function(){try{document.getElementsByName("busquedas")[0].click();Ext.getCmp("Paquete").setValue(paquete);}catch(e){}},
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando ..."
});
Ext.getCmp("Paquete").setValue(paquete);
}
function documentoMostrar(tipo){
$("tdfisica").style.display='none';
$("tdjuridica").style.display='none';
$("tdnombre").style.display='none';
$("tdtelefono").style.display='none';
$("tdotro").style.display='none';
$("tdplaca").style.display='none';
$("tdfinca").style.display='none';
$("tdavanzado").style.display='none';
switch(tipo){
case'1':$("tdfisica").style.display='';break;
case'2':$("tdjuridica").style.display='';break;
case'3':$("tdnombre").style.display='';break;
case'4':$("tdtelefono").style.display='';break;
case'5':$("tdplaca").style.display='';break;
case'6':$("tdfinca").style.display='';break;
case'7':$("tdotro").style.display='';break;
case'8':$("tdavanzado").style.display='';break;
default:window.alert("Error !!!\nTipo de documento no encontrado.");break;
}
$("Tipo_Documento").value=tipo;
}
function documentoFormar(d){
var tipo_documento=0;
try{
tipo_documento=parseInt($("Tipo_Documento").value);
}catch(e){
tipo_documento=0;
}
var documento="";
switch(tipo_documento){
case 1:documento+=Ext.getCmp("txtF1").getValue().trim()+"-"+Ext.getCmp("txtF2").getValue().trim()+"-"+Ext.getCmp("txtF3").getValue().trim();break;
case 2:documento+=Ext.getCmp("txtJ1").getValue().trim()+"-"+Ext.getCmp("txtJ2").getValue().trim()+"-"+Ext.getCmp("txtJ3").getValue().trim();break;
case 3:documento+=Ext.getCmp("txtNomBusca").getValue().trim();break;
case 4:documento+=Ext.getCmp("txtTelBusca").getValue().trim();break;
case 5:documento+=Ext.getCmp("txtClase").getValue().trim()+(Ext.getCmp("txtClase").getValue().trim()!=""?"-":"")+Ext.getCmp("txtCodigo").getValue().trim()+(Ext.getCmp("txtCodigo").getValue().trim()!=""?"-":"")+Ext.getCmp("txtPlaca").getValue().trim().lPad(6,'0');break;
case 6:documento+=$("cmbProvincia").value.trim()+"-"+Ext.getCmp("txtFinca").getValue().trim()+"-"+Ext.getCmp("txtDuplicado").getValue().trim()+"-"+Ext.getCmp("txtHorizontal").getValue().trim()+"-"+Ext.getCmp("txtDerecho").getValue().trim();break;
case 7:documento+=Ext.getCmp("txtOtro").getValue().trim();break;
case 8:documento+=Ext.getCmp('txtNom').getValue().trim();break;
}
if(d)
documento=d;
return documento;
}
function documentoCallFormar(d){
var tipo_documento=0;
try{
tipo_documento=parseInt($("Tipo_Documento").value);
}catch(e){
tipo_documento=0;
}
var documento="";
switch(tipo_documento){
case 1:documento+=Ext.getCmp("txtF1").getValue().trim()+"-"+Ext.getCmp("txtF2").getValue().trim()+"-"+Ext.getCmp("txtF3").getValue().trim();break;
case 2:documento+=Ext.getCmp("txtJ1").getValue().trim()+"-"+Ext.getCmp("txtJ2").getValue().trim()+"-"+Ext.getCmp("txtJ3").getValue().trim();break;
case 3:documento+=Ext.getCmp("txtNomBusca").getValue().trim();break;
case 4:documento+=Ext.getCmp("txtTelBusca").getValue().trim();break;
case 5:documento+=Ext.getCmp("txtClase").getValue().trim()+(Ext.getCmp("txtClase").getValue().trim()!=""?"-":"")+Ext.getCmp("txtCodigo").getValue().trim()+(Ext.getCmp("txtCodigo").getValue().trim()!=""?"-":"")+Ext.getCmp("txtPlaca").getValue().trim().lPad(6,'0');break;
case 6:documento+=$("cmbProvincia").value.trim()+"-"+Ext.getCmp("txtFinca").getValue().trim()+"-"+Ext.getCmp("txtDuplicado").getValue().trim()+"-"+Ext.getCmp("txtHorizontal").getValue().trim()+"-"+Ext.getCmp("txtDerecho").getValue().trim();break;
case 7:documento+=Ext.getCmp("txtOtro").getValue().trim();break;
case 8:documento+=Ext.getCmp('txtNom').getValue().trim();break;
}
if(d)
documento=d;
return documento;
}
function documentoOpcional(){
var tipo_documento=0;
try{
tipo_documento=parseInt($("Tipo_Documento").value);
}catch(e){
tipo_documento=0;
}
var documento="";
switch(tipo_documento){
case 4:documento+=Ext.getCmp("txtTelBusca").getValue();break;
case 5:documento+=Ext.getCmp("txtClase").getValue()+(Ext.getCmp("txtClase").getValue()!=""?"-":"")+Ext.getCmp("txtCodigo").getValue()+(Ext.getCmp("txtCodigo").getValue()!=""?"-":"")+Ext.getCmp("txtPlaca").getValue();break;
case 6:documento+=Ext.getCmp("txtFinca").getValue();break;
}
return documento;
}
function documentoBuscar(t){
if(inicio){
Ext.Msg.alert('Alerta','Ya inicio un proceso de Busqueda por favor espere que termine ...');
return;
}
try{t.disable();}catch(e){}
inicio=true;
if(documentoFormar().replace('-','').replace('000000','').replace('---','').length<=1){
Ext.Msg.alert('Alerta','No ha digitado un documento valido para realizar la Busqueda ...');
try{t.enable();}catch(e){}
inicio=false;
return;
}
var urlpage="";
switch($("Tipo_Documento").value){
case'1':case'2':case'7':urlpage="buscaridentificacion.jsp";break;
case'3':urlpage="buscarnombre.jsp";break;
case'4':urlpage="buscartelefono.jsp";break;
case'5':urlpage="buscarplaca.jsp";break;
case'6':urlpage="buscarfinca.jsp";break;
case'8':urlpage="buscaravanzado2.jsp";break;
default:window.alert("Error !!!\nTipo de documento no encontrado.");return;break;
}
Ext.get("screenDetailListaEstudios").load({
method:'POST',
disableCaching:true,
url:urlpage+"?_dc="+(new Date()).getTime(),
scripts:true,
scope:null,
discardUrl:false,
nocache:false,
text:"Cargando ...",
callback:function(){
try{t.enable();}catch(e){}
inicio=false;
},
params:{"Documento":documentoFormar(),"Sexo":$('cmbSexo').value,"Nombre":$('txtNom').value,"Edad1":$('txtE1').value,"Edad2":$('txtE2').value}
});
}
function documentoCallBuscar(t){
if(inicio){
Ext.Msg.alert('Alerta','Ya inicio un proceso de Busqueda por favor espere que termine ...');
return;
}
try{t.disable();}catch(e){}
inicio=true;
if(documentoCallFormar().replace('-','').replace('000000','').replace('---','').length<=1){
Ext.Msg.alert('Alerta','No ha digitado un documento valido para realizar la Busqueda ...');
try{t.enable();}catch(e){}
inicio=false;
return;
}
var urlpage="";
switch($("Tipo_Documento").value){
case'1':case'2':case'7':urlpage="buscaridentificacion.jsp";break;
case'3':urlpage="buscarnombre.jsp";break;
case'4':urlpage="buscartelefono.jsp";break;
case'5':urlpage="buscarplaca.jsp";break;
case'6':urlpage="buscarfinca.jsp";break;
case'8':urlpage="buscaravanzado2.jsp";break;
default:window.alert("Error !!!\nTipo de documento no encontrado.");return;break;
}
Ext.get("call-ListaTrabajo").load({
autoHeight:true,
url:urlpage,
scripts:true,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando ...",
callback:function(){
try{t.enable();}catch(e){}
inicio=false;
},
params:{"Documento":documentoCallFormar(),"Sexo":$('cmbSexo').value,"Nombre":$('txtNom').value,"Edad1":$('txtE1').value,"Edad2":$('txtE2').value}
});
}
function estudioSolicitar(m,l,o,d,p,op){
if(inicio){
Ext.Msg.alert('Alerta','Ya inicio un proceso de Busqueda por favor espere que termine ...');
return;
}
try{
t.disable();
}catch(e){}
inicio=true;
if(documentoFormar(d).replace('-','').replace('000000','').replace('---','').length<=1){
Ext.Msg.alert('Alerta','No ha digitado un documento valido para realizar la Solicitud ...');
return;
}
if(documentoFormar(d).split(',').length>15){
Ext.Msg.alert('Alerta','No puede solicitar mas de 15 Identificaciones ...');
return;
}
var paquete='';
try{
paquete=Ext.getCmp("Paquete").getValue();
}catch(e){
paquete='';
}
if(p)
paquete=p;
ToastProgress();
Ext.Ajax.request({
url:'../servcliente/paquetebuscar.jsp',
method:'POST',
disableCaching:true,
params:{Consecutivo:paquete},
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
}
if(data.Consecutivo>0){
if(data.BaseDatos==false){
ToastEnd();
var url="";
if(data.SolicitaInformacionLaboral)
url="reflabsolicitar.jsp";
if(data.SolicitaInformacionComercial)
url="refcomsolicitar.jsp";
if(url!=""){
inicio=false;
referenciasSolicitar(url,paquete,d);
try{t.enable();}catch(e){}
}
else
estudioGuardar(d,paquete,false,l,o,op);
}else{
estudioGuardar(d,paquete,m,l,o,op);
}
try{
Ext.getCmp("txtF1").reset();
Ext.getCmp("txtF2").reset();
Ext.getCmp("txtF3").reset();
Ext.getCmp("txtJ1").reset();
Ext.getCmp("txtJ2").reset();
Ext.getCmp("txtJ3").reset();
Ext.getCmp("txtNomBusca").reset();
Ext.getCmp("txtTelBusca").reset();
Ext.getCmp("txtOtro").reset();
Ext.getCmp("txtNom").reset();
Ext.getCmp("txtClase").reset();
Ext.getCmp("txtCodigo").reset();
Ext.getCmp("txtPlaca").reset();
Ext.getCmp("cmbProvincia").reset();
Ext.getCmp("txtFinca").reset();
Ext.getCmp("txtDuplicado").reset();
Ext.getCmp("txtHorizontal").reset();
Ext.getCmp("txtDerecho").reset();
t.disable();
}catch(e){}
}
}catch(err){
inicio=false;
Ext.MessageBox.alert('Error',err.message);
try{t.enable();}catch(e){}
ToastEnd();
}
}else{
inicio=false;
ToastError(response.responseText);
try{t.enable();}catch(e){}
}
}
});
}
function estudioGuardar(d,p,m,l,o,op){
var Tdoc;
var Suc;
var opcional=documentoOpcional();
if(op)
opcional=op;
try{
Tdoc=$("Tipo_Documento").value;
Suc=$("txtSucursal").value;
}catch(e){}
Ext.Ajax.request({
url:'estudioguardar.jsp',
method:'POST',
disableCaching:true,
params:{Paquete:p,Tipo_Documento:Tdoc,Documento:documentoFormar(d),Sucursal:Suc,Opcional:opcional},
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Consecutivo=="0"){ToastError("Atención !!!<br/>"+data.Msg);inicio=false;return 0;}
if(m)if(data.Consecutivo!="0")ver(data.Consecutivo);
if(l)listar();
try{t.enable();}catch(e){}
inicio=false;
ToastEnd();
}catch(err){
inicio=false;
Ext.MessageBox.alert('Error',err.message);
try{t.enable();}catch(e){}
}
}else{
inicio=false;
ToastError(response.responseText);
try{t.enable();}catch(e){}
}
}
});
return e;
}
function estudiorapidoguardar(P,T,D,M){
ToastProgress();
Ext.Ajax.request({
url:'estudioguardar.jsp',
method:'POST',
disableCaching:true,
params:{Paquete:P,Tipo_Documento:T,Documento:D},
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Consecutivo=="0"){ToastError("Atención !!!\n"+data.Msg);return 0;}
if(data.Consecutivo!="0")
if(M)ver(data.Consecutivo);
ToastEnd();
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
function estudiopoliticasguardar(P,T,D,X,R,M,L){
try{
ToastProgress();
}catch(e){}
Ext.Ajax.request({
url:'estudioguardar.jsp',
method:'POST',
disableCaching:true,
params:{Paquete:P,Tipo_Documento:T,Documento:D},
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Consecutivo=="0"){ToastError("Atención !!!\n"+data.Msg);return 0;}
if(data.Consecutivo!="0"){
politicaslistaguardar(data.Consecutivo,R,L,X);
if(M)ver(data.Consecutivo,P,R,X);
}
ToastEnd();
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
function politicaslistaguardar(E,R,L,X){
Ext.Ajax.request({
url:'politicasguardar.jsp',
method:'POST',
disableCaching:true,
params:{estudio:E,regla:R,xml:X},
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(L)listarPoliticas();
ToastEnd();
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
function listarPoliticas(){
Ext.getCmp("gridPoliticas").getStore().load({params:{start:0,limit:30}});
}
function referenciasSolicitar(pageurl,paq,doc){
var paquete=$("Paquete").value;
if(paq)
paquete=paq;
Ext.get("screenDetailListaEstudios").load({
url:pageurl,
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:true,
params:{Paquete:paquete,Tipo_Documento:$("Tipo_Documento").value,Documento:documentoFormar(doc)},
text:"Cargando ..."
});
}
function rcAgregar(l,t,c){
if(l==""||t==""){
Ext.Msg.alert('Alerta','Por favor complete los datos solicitados para continuar.');
return false;
}
Ext.get("divRefCom").load({
url:"refcomlistar.jsp",
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:true,
params:{Lugar:l,Telefono:t,Contacto:c},
text:"Cargando ..."
});
}
function rcEliminar(i){
Ext.get("divRefCom").load({
url:"refcomlistar.jsp",
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:true,
params:{Del:i},
text:"Cargando ..."
});
}
function rlAgregar(l,t,c,up,ji){
if(l==""||t==""||up==""||ji==""){
Ext.Msg.alert('Alerta','Por favor complete los datos solicitados para continuar.');
return false;
}
Ext.get("divRefCom").load({
url:"reflablistar.jsp",
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:true,
params:{Lugar:l,Telefono:t,Contacto:c,Ultimo_Puesto:up,Jefe_Inmediato:ji},
text:"Cargando ..."
});
}
function rlEliminar(i){
Ext.get("divRefCom").load({
url:"reflablistar.jsp",
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:true,
params:{Del:i},
text:"Cargando ..."
});
}
function referenciasGuardar(frm){
ToastProgress();
dojo.io.bind({
url:"estudioactualizadoguardar.jsp",
mimetype:"text/json",
method:"POST",
formNode:$(frm),
load:function(type,data,event){
if(!data){window.alert("Error al solicitar estudio.");return;}
if(data.Consecutivo==""){window.alert("Atención !!!\n"+data.Msg);return;}
listar();
ToastEnd();
},
error:function(type,errorObject){window.alert("Error: "+type+"\n"+errorObject.message);}
});
}
function estudioprepago(){
Ext.Ajax.request({
url:'../facturacion/Prepago-calculo.jsp',
method:'POST',
disableCaching:true,
timeout:300000,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.consecutivo!=0){
$('EstadoCuenta').style.display="";
$('MontoCuenta').innerHTML=data.monedaSimbolo+' '+Ext.util.Format.Currency(data.saldo);
switch(data.moneda){
case 1:{
if(data.saldo<5000&&data.saldo>2000)
Ext.Msg.alert("Alerta !!!","Su disponible esta por agotarse  por favor recuerde realizar la recarga  en Cero Riesgo. Muchas Gracias !!!");
if(data.saldo<2000)
Ext.Msg.alert("Alerta !!!","Su Crédito disponible para realizar estudios esta casi agotado. Por favor Realizar la recarga para que pueda continuar con sus consultas sin ningún problema !!!");
break;
}
case 2:{
if(data.saldo<10&&data.saldo>4)
Ext.Msg.alert("Alerta !!!","Su disponible esta por agotarse  por favor recuerde realizar la recarga  en Cero Riesgo. Muchas Gracias !!!");
if(data.saldo<4)
Ext.Msg.alert("Alerta !!!","Su Crédito disponible para realizar estudios esta casi agotado. Por favor Realizar la recarga para que pueda continuar con sus consultas sin ningún problema !!!");
break;
}
}
}
}catch(err){
}
}else{
ToastError(response.responseText);
}
}
});
}
function ver(c,pa,r,xml){
var p=0;
try{
p=c.split(",").length;
}catch(e){p=0;}
if(p>CantVer){
Ext.Msg.alert('Alerta','Solo puede Ver un maximo de '+CantVer+' Estudios en una sola consulta ...');
inicio=false;
return;
}
var myform=document.createElement("form");
if(pa!=76)
myform.action='estudiover.jsp?_dc='+(new Date()).getTime();
else
myform.action='politicaevaluar.jsp';
myform.method='POST';
myform.target='_blank';
var myinput=document.createElement("input");
myinput.type='text';
myinput.name='Consecutivo';
myinput.value=c;
myform.appendChild(myinput);
document.body.appendChild(myform);
if(pa==76){
var myinput1=document.createElement("input");
myinput1.type='text';
myinput1.name='radRegla';
myinput1.value=r;
myform.appendChild(myinput1);
var myinputX=document.createElement("input");
myinputX.type='text';
myinputX.name='xml';
myinputX.value=xml;
myform.appendChild(myinputX);
}
myform.submit();
document.body.removeChild(myform);
}
function vistamultiple(es){
if(es==""){
ToastError("No ha seleccionado ningún estudio para ver/mostrar.");
return;
}
ver(es);
}
function borrar(es){
if(es==""){
ToastError("No ha seleccionado ningún estudio para eliminar de la lista.");
return;
}
Ext.Msg.show({
title:'Confirmación',
msg:'¿Está seguro(a) de eliminar de la lista los estudios seleccionados?',
buttons:Ext.Msg.YESNOCANCEL,
fn:function(btn){
if(btn=='yes'){
ToastProgress();
Ext.Ajax.request({
url:'estudiosborrar.jsp',
method:'POST',
disableCaching:true,
params:{"Estudios":es},
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Status=="OK"){
ToastAlert(data.Msg);
}
else
ToastError(data.Msg);
listar();
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
},
animEl:'elId',
icon:Ext.MessageBox.QUESTION
});
}
function borrarpoliticas(es){
if(es==""){
ToastError("No ha seleccionado ningún estudio para eliminar de la lista.");
return;
}
Ext.Msg.show({
title:'Confirmación',
msg:'¿Está seguro(a) de eliminar de la lista los estudios seleccionados?',
buttons:Ext.Msg.YESNOCANCEL,
fn:function(btn){
if(btn=='yes'){
ToastProgress();
Ext.Ajax.request({
url:'politicasborrar.jsp',
method:'POST',
disableCaching:true,
params:{"Estudios":es},
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Status=="OK"){
ToastAlert(data.Msg);
}
else
ToastError(data.Msg);
listarPoliticas();
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
},
animEl:'elId',
icon:Ext.MessageBox.QUESTION
});
}
function creditscore(ced){
e.EstudioRapidoGuardar(43,0,ced,false);
var myform=document.createElement("form");
myform.action='creditscore.jsp';
myform.method='POST';
myform.target='_blank';
var myinput=document.createElement("input");
myinput.type='text';
myinput.name='cedula';
myinput.value=ced;
myform.appendChild(myinput);
document.body.appendChild(myform);
myform.submit();
document.body.removeChild(myform);
}
}
function EstudiosCallCenter(){
var CantVer=20;
var inicio=false;
this.Solicita=solicita;
this.Listar=listar;
this.Desplazamiento=desplazamientoListar;
this.TodosMarcar=todosMarcar;
this.VPMarcar=vpMarcar;
this.PaqueteMarcar=paqueteMarcar;
this.TipoDocumentoMostrar=tipoDocumentoMostrar;
this.DocumentoMostrar=documentoMostrar;
this.DocumentoBuscar=documentoBuscar;
this.EstudioSolicitar=estudioSolicitar;
this.ReferenciasSolicitar=referenciasSolicitar;
this.Info=info;
this.Ver=ver;
this.VistaMultiple=vistamultiple;
this.Borrar=borrar;
this.Buscar=buscar;
function buscar(c){
if(c.length>=4){
Ext.get("screenDetailListaEstudios").load({
url:"estudiosbuscar2.jsp",
params:{criterio:c},
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:false,
text:"Cargando ..."
});
}
else
Ext.Msg.alert('Alerta','Criterio de busqueda muy pequeño...');
}
function info(){
window.alert("Solicitar estudios\nCero Riesgo, S.A.");
}
function solicita(){
ToastProgress();
dojo.io.bind({
url:"estudiosolicitar.jsp",
mimetype:"text/html",
method:"GET",
preventCache:"true",
load:function(type,data,event){$("screenDetail").innerHTML=data;paqueteMarcar();ToastEnd();},
error:function(type,errorObject){window.alert("Error: "+type+"\n"+errorObject.message);}
});
}
function listar(){
var tabinf=Ext.getCmp("tabinf");
var id='screenDetailListaEstudios'
var t=tabinf.getComponent(id);
if(t){
t.load({
url:'callcenter_lista.jsp',
scripts:true,
scope:null,
discardUrl:false,
nocache:false,
text:"Cargando ...",
callback:null
});
}
}
function desplazamientoListar(desplazamiento){
Ext.get("screenDetailListaEstudios").load({
url:"estudioslistar.jsp",
params:{d:desplazamiento},
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:false,
text:"Cargando ..."
});
}
function paqueteMarcar(paq){
var p=document.getElementsByName("radPaquete");
var pref=false;
if(paq)
pref=true
if(p!=null){
var marca=false;
for(var i=0;i<p.length;i++){
if(!p[i].disabled)
if(!marca){
if(pref){
if(p[i].value==paq){
p[i].click();
marca=true;
}
}else{
p[i].click();
marca=true;
}
}
}
}
}
function todosMarcar(b){
var chks=document.getElementsByName("chkEstudio");
for(i=0;i<chks.length;i++)chks[i].checked=b;
}
function vpMarcar(b){
var chkEstudios=document.getElementsByName("chkEstudio");
var chkVistos=document.getElementsByName("chkVisto");
todosMarcar(false);
for(i=0;i<chkVistos.length;i++){
if(chkVistos[i].checked&&b)
chkEstudios[i].checked=true;
else if(!chkVistos[i].checked&&!b)
chkEstudios[i].checked=true;
}
}
function tipoDocumentoMostrar(paquete){
Ext.getCmp("divBusqueda").load({
url:"busquedasxpaquetes.jsp",
params:{Paquete:paquete},
scripts:true,
callback:function(){try{document.getElementsByName("busquedas")[0].click();Ext.getCmp("Paquete").setValue(paquete);}catch(e){}},
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando ..."
});
Ext.getCmp("Paquete").setValue(paquete);
}
function documentoMostrar(tipo){
$("tdfisica").style.display='none';
$("tdjuridica").style.display='none';
$("tdnombre").style.display='none';
$("tdtelefono").style.display='none';
$("tdotro").style.display='none';
$("tdplaca").style.display='none';
$("tdfinca").style.display='none';
$("tdavanzado").style.display='none';
switch(tipo){
case'1':$("tdfisica").style.display='';break;
case'2':$("tdjuridica").style.display='';break;
case'3':$("tdnombre").style.display='';break;
case'4':$("tdtelefono").style.display='';break;
case'5':$("tdplaca").style.display='';break;
case'6':$("tdfinca").style.display='';break;
case'7':$("tdotro").style.display='';break;
case'8':$("tdavanzado").style.display='';break;
default:window.alert("Error !!!\nTipo de documento no encontrado.");break;
}
$("Tipo_Documento").value=tipo;
}
function documentoFormar(d){
var tipo_documento=0;
try{
tipo_documento=parseInt($("Tipo_Documento").value);
}catch(e){
tipo_documento=0;
}
var documento="";
switch(tipo_documento){
case 1:documento+=$("txtF1").value.trim()+"-"+$("txtF2").value.trim()+"-"+$("txtF3").value.trim();break;
case 2:documento+=$("txtJ1").value.trim()+"-"+$("txtJ2").value.trim()+"-"+$("txtJ3").value.trim();break;
case 3:documento+=$("txtNomBusca").value.trim();break;
case 4:documento+=$("txtTelBusca").value.trim();break;
case 5:documento+=$("txtClase").value.trim()+($("txtClase").value.trim()!=""?"-":"")+$("txtCodigo").value.trim()+($("txtCodigo").value.trim()!=""?"-":"")+$("txtPlaca").value.trim().lPad(6,'0');break;
case 6:documento+=$("cmbProvincia").value.trim()+"-"+$("txtFinca").value.trim()+"-"+$("txtDuplicado").value.trim()+"-"+$("txtHorizontal").value.trim()+"-"+$("txtDerecho").value.trim();break;
case 7:documento+=$("txtOtro").value.trim();break;
case 8:documento+=$('txtNom').value.trim();break;
}
if(d)
documento=d;
return documento;
}
function documentoOpcional(){
var tipo_documento=0;
try{
tipo_documento=parseInt($("Tipo_Documento").value);
}catch(e){
tipo_documento=0;
}
var documento="";
switch(tipo_documento){
case 4:documento+=Ext.getCmp("txtTelBusca").getValue();break;
case 5:documento+=Ext.getCmp("txtClase").getValue()+(Ext.getCmp("txtClase").getValue()!=""?"-":"")+Ext.getCmp("txtCodigo").getValue()+(Ext.getCmp("txtCodigo").getValue()!=""?"-":"")+Ext.getCmp("txtPlaca").getValue();break;
case 6:documento+=Ext.getCmp("txtFinca").getValue();break;
}
return documento;
}
function documentoBuscar(t){
if(inicio){
Ext.Msg.alert('Alerta','Ya inicio un proceso de Busqueda por favor espere que termine ...');
return;
}
try{t.disable();}catch(e){}
inicio=true;
if(documentoFormar().replace('-','').replace('000000','').replace('---','').length<=1){
Ext.Msg.alert('Alerta','No ha digitado un documento valido para realizar la Busqueda ...');
try{t.enable();}catch(e){}
inicio=false;
return;
}
var urlpage="";
switch($("Tipo_Documento").value){
case'1':case'2':case'7':urlpage="buscaridentificacion.jsp";break;
case'3':urlpage="buscarnombre.jsp";break;
case'4':urlpage="buscartelefono.jsp";break;
case'5':urlpage="buscarplaca.jsp";break;
case'6':urlpage="buscarfinca.jsp";break;
case'8':urlpage="buscaravanzado2.jsp";break;
default:window.alert("Error !!!\nTipo de documento no encontrado.");return;break;
}
var tabinf=Ext.getCmp("tabinf");
var id='screenDetailListaEstudios'
var t=tabinf.getComponent(id);
if(t){
t.load({
url:urlpage,
scripts:true,
scope:null,
discardUrl:false,
nocache:false,
text:"Cargando ...",
callback:function(){
try{t.enable();}catch(e){}
inicio=false;
},
params:{"Documento":documentoFormar(),"Sexo":$('cmbSexo').value,"Nombre":$('txtNom').value,"Edad1":$('txtE1').value,"Edad2":$('txtE2').value}
});
}
}
function estudioSolicitar(m,l,o,d,p){
if(inicio){
Ext.Msg.alert('Alerta','Ya inicio un proceso de Busqueda por favor espere que termine ...');
return;
}
try{
t.disable();
}catch(e){}
inicio=true;
if(documentoFormar(d).replace('-','').replace('000000','').replace('---','').length<=1){
Ext.Msg.alert('Alerta','No ha digitado un documento valido para realizar la Solicitud ...');
return;
}
if(documentoFormar(d).split(',').length>15){
Ext.Msg.alert('Alerta','No puede solicitar mas de 15 Identificaciones ...');
return;
}
var paquete='';
try{
paquete=$("Paquete").value;
}catch(e){
paquete='';
}
if(p)
paquete=p;
ToastProgress();
Ext.Ajax.request({
url:'../servcliente/paquetebuscar.jsp',
method:'POST',
disableCaching:true,
params:{Consecutivo:paquete},
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
}
if(data.Consecutivo>0){
if(data.BaseDatos==false){
ToastEnd();
var url="";
if(data.SolicitaInformacionLaboral)
url="reflabsolicitar.jsp";
if(data.SolicitaInformacionComercial)
url="refcomsolicitar.jsp";
if(url!=""){
inicio=false;
referenciasSolicitar(url,paquete,d);
try{t.enable();}catch(e){}
}
else
estudioGuardar(d,paquete,false,l,o);
}else{
estudioGuardar(d,paquete,m,l,o);
}
try{
Ext.getCmp("txtF1").reset();
Ext.getCmp("txtF2").reset();
Ext.getCmp("txtF3").reset();
Ext.getCmp("txtJ1").reset();
Ext.getCmp("txtJ2").reset();
Ext.getCmp("txtJ3").reset();
Ext.getCmp("txtNomBusca").reset();
Ext.getCmp("txtTelBusca").reset();
Ext.getCmp("txtOtro").reset();
Ext.getCmp("txtNom").reset();
Ext.getCmp("txtClase").reset();
Ext.getCmp("txtCodigo").reset();
Ext.getCmp("txtPlaca").reset();
Ext.getCmp("cmbProvincia").reset();
Ext.getCmp("txtFinca").reset();
Ext.getCmp("txtDuplicado").reset();
Ext.getCmp("txtHorizontal").reset();
Ext.getCmp("txtDerecho").reset();
t.disable();
}catch(e){}
}
}catch(err){
inicio=false;
Ext.MessageBox.alert('Error',err.message);
try{t.enable();}catch(e){}
ToastEnd();
}
}else{
inicio=false;
ToastError(response.responseText);
try{t.enable();}catch(e){}
}
}
});
}
function estudioGuardar(d,p,m,l,o){
Ext.Ajax.request({
url:'estudioguardar.jsp',
method:'POST',
disableCaching:true,
params:{Paquete:p,Tipo_Documento:$("Tipo_Documento").value,Documento:documentoFormar(d),Sucursal:$("txtSucursal").value,Opcional:documentoOpcional()},
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Consecutivo=="0"){ToastError("Atención !!!<br/>"+data.Msg);inicio=false;return 0;}
if(m)if(data.Consecutivo!="0")ver(data.Consecutivo);
if(l)listar();
try{t.enable();}catch(e){}
inicio=false;
ToastEnd();
}catch(err){
inicio=false;
Ext.MessageBox.alert('Error',err.message);
try{t.enable();}catch(e){}
}
}else{
inicio=false;
ToastError(response.responseText);
try{t.enable();}catch(e){}
}
}
});
return e;
}
function referenciasSolicitar(pageurl,paq,doc){
var paquete=$("Paquete").value;
if(paq)
paquete=paq;
Ext.get("screenDetailListaEstudios").load({
url:pageurl,
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:true,
params:{Paquete:paquete,Tipo_Documento:$("Tipo_Documento").value,Documento:documentoFormar(doc)},
text:"Cargando ..."
});
}
function ver(c,pa,r,xml){
$('Consecutivo').value=c;
Ext.getDom("tmpForm").submit();
var tabinf=Ext.getCmp("tabinf");
var id='call-informacion';
var t=tabinf.getComponent(id);
if(t){
tabinf.setActiveTab(t);
return;
}
}
function vistamultiple(es){
if(es==""){
ToastError("No ha seleccionado ningún estudio para ver/mostrar.");
return;
}
ver(es);
}
function borrar(es){
if(es==""){
ToastError("No ha seleccionado ningún estudio para eliminar de la lista.");
return;
}
Ext.Msg.show({
title:'Confirmación',
msg:'¿Está seguro(a) de eliminar de la lista los estudios seleccionados?',
buttons:Ext.Msg.YESNOCANCEL,
fn:function(btn){
if(btn=='yes'){
ToastProgress();
Ext.Ajax.request({
url:'callcenter_estudiosborrar.jsp',
method:'POST',
disableCaching:true,
params:{"Estudios":es},
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Status=="OK"){
ToastAlert(data.Msg);
}
else
ToastError(data.Msg);
listar();
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
},
animEl:'elId',
icon:Ext.MessageBox.QUESTION
});
}
}
function VistaEstudio(){
this.Resumen=resumen;
this.ResumenAll=resumenall;
this.InitMenu=initmenu;
this.AmpliarFoto=ampliarfoto;
this.SMS=sms;
this.MuestaFoto=muestrafoto;
this.Juicios=juicios;
this.Personeria=personeria;
this.MenuMultiple=menumultiple;
this.Docment=docment;
function docment(){
var ret="";
var vc=document.getElementsByTagName("input");
for(var i=0;i!=vc.length;i++){
if(vc[i].type=='checkbox'){
if(vc[i].checked)
ret+=vc[i].value+',';
}
if(ret.split(',').length>16){
Ext.Msg.alert('Alerta','no puede hacer mas de 15 estudios');
return"";
}
}
if(ret.length>0)
ret=ret.substring(0,ret.length-1);
return ret;
}
function menumultiple(obj){
var count=docment().split(',').length;
if(obj.checked){
document.getElementById("btnCedulas").style.display="";
topestudios();
}
if(count<2)
document.getElementById("btnCedulas").style.display="none";
else
if(count>1)
document.getElementById("btnCedulas").style.display="";
}
function resumenall(obj,numero){
var listtable=document.getElementsByTagName('table');
var listdiv=document.getElementsByTagName('div');
for(var i=0;i<listtable.length;i++){
if(listtable[i].id!=''){
if(listtable[i].className=="Rdorado")
listtable[i].className="dorado";
else
listtable[i].className="Rdorado";
}
}
for(var j=0;j<listdiv.length;j++){
if(listdiv[j].className=='expandir'||listdiv[j].className=='contraer'){
if(listdiv[j].className=="expandir")
listdiv[j].className="contraer";
else
listdiv[j].className="expandir";
}
}
try{
if(obj.className=="expandirall")
obj.className="contraerall";
else
obj.className="expandirall";
}catch(e){}
}
function resumen(obj,tbl,numero){
try{
if(obj.className=="expandir"){
obj.className="contraer";
Ext.get(tbl+numero).dom.className="Rdorado";
Ext.get('R'+tbl+numero).dom.className="dorado";
}
else{
obj.className="expandir";
Ext.get(tbl+numero).dom.className="dorado";
Ext.get('R'+tbl+numero).dom.className="Rdorado";
}
}catch(e){}
}
function initmenu(){
Ext.Ajax.request({
url:'../main/paquetesxclientexvistaestudio.jsp',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
Paquetes=data.Paquetes;
}catch(err){
ToastError(err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
function ampliarfoto(c){
var win=new Ext.Window({
width:510,
height:345,
shadow:true,
closable:true,
layout:'fit',
plain:true,
modal:true,
resizable:false,
title:'Foto Ampliada',
listeners:{
activate:function(p){
p.load({
url:'fotoampliada.jsp',
params:{identificacion:c},
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
}
});
win.show();
}
function sms(c){
var win=new Ext.Window({
width:600,
height:500,
shadow:true,
closable:true,
layout:'fit',
plain:true,
modal:true,
resizable:true,
title:'Envio SMS',
autoLoad:{
url:'sms.jsp',
params:{Celular:c},
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:false,
timeout:30,
text:'Cargando ...'
}
});
win.show();
}
function muestrafoto(obj,ced){
e.EstudioRapidoGuardar(40,0,ced,false);
Ext.onReady(function(){
Ext.get(obj).load({
url:"estudiofoto.jsp",
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:true,
params:{"cedula":ced},
text:"Cargando ..."
});
},true);
document.getElementById(obj).onclick='V.AmpliarFoto(\''+ced+'\');';
}
function juicios(obj,ced){
Ext.Ajax.request({
url:'../main/sessionDatos.jsp',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
var titulo="Estimado "+data.usuario.nombre+"\n";
var texto="Esta es una petición de verificación judicial de la cédula "+ced+" <br/>";
texto+="Desea continuar con la solicitud de esta investigación ?<br/>";
texto+="";
MsgJuicios(obj,ced,texto,titulo);
}catch(err){
ToastError(err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
function MsgJuicios(obj,ced,msg,t){
Ext.Msg.show({
title:t,
msg:msg,
buttons:Ext.Msg.YESNOCANCEL,
fn:function(btn){
if(btn=='yes'){
ToastProgress();
Ext.Ajax.request({
url:'../main/estudioactualizadoguardar.jsp',
method:'POST',
params:{Documento:ced,Paquete:61,chkTopicoSolicitar:[10]},
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Consecutivo!=0){
var texto="Esta investigación tarda entre 8 y 16 horas laborales, transcurrido este tiempo,<br/>";
texto+=" le solicitamos que ingrese nuevamente al sistema para que verifique en el estudio<br/>";
texto+=" el estatus actual.<br/><br/>";
texto+="Si tiene dudas le agradecemos nos llame al 2241-2526, nuestro departamento de servicio al cliente,";
texto+=" le atenderá gustosamente.<br/><br/>";
texto+="Muchas Gracias.";
Ext.Msg.alert('Verificación Judicial',texto);
obj.style.display="none";
ToastEnd();
}else{
ToastError(data.Msg);
}
}catch(err){
ToastError(err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
},
animEl:'elId',
icon:Ext.MessageBox.QUESTION
});
}
function personeria(obj,ced){
Ext.Ajax.request({
url:'../main/sessionDatos.jsp',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
var titulo="Estimado "+data.usuario.nombre+"\n";
var texto="Esta es una petición de Actualizar personeria juridica de la cédula "+ced+" <br/>";
texto+="Desea continuar con la solicitud de esta investigación ?<br/>";
MsgPersoneria(obj,ced,texto,titulo);
}catch(err){
ToastError(err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
function MsgPersoneria(obj,ced,msg,t){
Ext.Msg.show({
title:t,
msg:msg,
buttons:Ext.Msg.YESNOCANCEL,
fn:function(btn){
if(btn=='yes'){
ToastProgress();
Ext.Ajax.request({
url:'../main/estudioactualizadoguardar.jsp',
method:'POST',
params:{Documento:ced,Paquete:60,chkTopicoSolicitar:[5]},
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Consecutivo!=0){
var texto="Esta investigación tarda entre 8 y 16 horas laborales, transcurrido este tiempo,<br/>";
texto+=" le solicitamos que ingrese nuevamente al sistema para que verifique en el estudio<br/>";
texto+=" el estatus actual.<br/><br/>";
texto+="Si tiene dudas le agradecemos nos llame al 2241-2526, nuestro departamento de servicio al cliente,";
texto+=" le atenderá gustosamente.<br/><br/>";
texto+="Muchas Gracias.";
Ext.Msg.alert('Actualización de Personeria',texto);
obj.style.display="none";
ToastEnd();
}else{
ToastError(data.Msg);
}
}catch(err){
ToastError(err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
},
animEl:'elId',
icon:Ext.MessageBox.QUESTION
});
}
}
function Contactos(){
this.Abrir=abrir;
this.Clear=clear;
this.Editar=editar;
this.Guardar=guardar;
this.Clave=clave;
this.Reset=reset;
this.Eliminar=eliminar;
this.Listar=listar;
this.Datos=datos;
this.Desactivar=desactivar;
function clear(){
Ext.getCmp("txtIdentificacion").setValue('');
Ext.getCmp("txtNombre").setValue('');
Ext.getCmp("txtNick").setValue('');
Ext.getCmp("txtNacio").setValue('');
Ext.getCmp("txtCelular").setValue('');
Ext.getCmp("txtEmail").setValue('');
Ext.getCmp("txtTelefono").setValue(0);
Ext.getCmp("txtConsecutivo").setValue(0);
try{
Ext.getCmp("txtUsuario").setValue('');
}catch(e){}
$("chkActivo").checked=true;
}
function abrir(con,cli,camb,m){
if(m){
ToastProgress();
dojo.io.bind({
url:"contacto.jsp",
mimetype:"text/html",
method:"GET",
content:{"Consecutivo":con,"Cliente":cli,"CambioClave":camb},
load:function(type,data,event){
$("screenDetailContacto").innerHTML=data;
editar(con,camb);
ToastEnd();
},
error:function(type,errorObject){window.alert("Error: "+type+"\n"+errorObject.message);}
});
}else{
var id='docs-contactos';
var t=tabs.getComponent(id);
if(t){
t.load({
params:{Consecutivo:con,Cliente:cli,CambioClave:camb},
url:"contacto.jsp",
callback:function(){editar(con,camb);},
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
return;
}
tabs.add({
title:'Usuario',
id:id,
autoScroll:true,
listeners:{activate:function(tab){
tab.load({
params:{Consecutivo:con,Cliente:cli,CambioClave:camb},
url:"contacto.jsp",
callback:function(){editar(con,camb);},
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}},
closable:true
}).show();
}
}
function editar(c,camb){
Ext.Ajax.request({
url:'../servcliente/contactobuscar.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
}
if(data.Identificacion)
Ext.getCmp("txtIdentificacion").setValue(data.Identificacion);
if(data.Nombre)
Ext.getCmp("txtNombre").setValue(data.Nombre);
if(data.Nick)
Ext.getCmp("txtNick").setValue(data.Nick);
if(data.Nacio)
Ext.getCmp("txtNacio").setValue(data.Nacio);
if(data.Celular)
Ext.getCmp("txtCelular").setValue(data.Celular);
if(data.Email)
Ext.getCmp("txtEmail").setValue(data.Email);
if(data.Telefono)
Ext.getCmp("txtTelefono").setValue(data.Telefono);
if(data.Consecutivo)
Ext.getCmp("txtConsecutivo").setValue(data.Consecutivo);
if(camb)Ext.getCmp("txtUsuario").setValue(data.Usuario);
Ext.getCmp("chkActivo").checked=data.Activo;
Ext.getCmp("chkActivo").setValue(data.Activo);
Ext.getCmp("Sexo").setValue(data.Sexo);
if(data.Perfiles[0]!=null){
for(i=0;i<data.Perfiles.length;i++){
try{
if(data.Perfiles[i].Consecutivo)
Ext.getCmp("Perfil").addValue(data.Perfiles[i].Consecutivo);
}catch(e){}
}
}
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
function guardar(obj){
obj.disable();
ToastProgress();
Ext.Ajax.request({
url:'../servcliente/contactoguardar.jsp',
form:'frmFormContacto',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
obj.enable();
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
}else
ToastEnd();
Ext.getCmp("txtConsecutivo").setValue(data.Consecutivo);
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
function clave(p){
ToastProgress();
Ext.Ajax.request({
url:'../servcliente/contactocambioclave.jsp',
form:'frmFormContacto',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
}
if(data.success==true)
window.location.href=p;
ToastEnd();
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
function reset(c){
ToastProgress();
Ext.Ajax.request({
url:'../servcliente/contactoresetclave.jsp',
method:'POST',
params:{consecutivo:c},
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
}
else
ToastEnd();
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
function eliminar(c){
var agree=window.confirm("¿Está seguro(a) de eliminar este contacto de la lista?");
if(!agree)return;
ToastProgress();
Ext.Ajax.request({
url:'../servcliente/contactoeliminar.jsp',
method:'POST',
params:{"Consecutivo":c},
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(!data){ToastError("Error al eliminar contacto.");return;}
if(data.Msg.indexOf("OK")!=-1)ToastAlert("Usuario Eliminado Satisfactoriamente!!");else
ToastEnd();
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
function listar(cri,cli,m){
if(m){
Ext.onReady(function(){
Ext.get("screenDetailContacto").load({
url:"contactoslistar.jsp",
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:true,
params:{Criterio:cri,Cliente:cli},
text:"Cargando ..."
});
},true);
}else{
var id='docs-AUsuarios';
var t=tabs.getComponent(id);
if(t){
tabs.setActiveTab(t);
return;
}
tabs.add({
title:'Lista Usuarios',
id:id,
autoLoad:{url:'contactoslistar.jsp',scripts:true,text:'Cargando ...',params:{Criterio:cri,Cliente:cli},callback:null,
scope:null,
discardUrl:false,
nocache:true},
closable:true
}).show();
}
}
function datos(i){
ToastProgress();
Ext.Ajax.request({
url:'../servcliente/contactobuscardatos.jsp',
params:{Identificacion:i},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
}
Ext.getCmp("txtIdentificacion").setValue(data.Identificacion);
Ext.getCmp("txtNombre").setValue(data.Nombre);
Ext.getCmp("txtCelular").setValue(data.Celular);
Ext.getCmp("txtNacio").setValue(data.Nacio);
ToastEnd();
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
function desactivar(u,m){
Ext.Ajax.request({
url:'../seguridad/contactodesactivar.jsp',
params:{txtModulo:m,txtUsuario:u},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
}
});
}
}
function Sugerencias(){
this.Abrir=abrir;
this.Guardar=guardar;
function abrir(con,cli,camb){
ToastProgress();
dojo.io.bind({
url:"sugerencia.jsp",
mimetype:"text/html",
method:"GET",
load:function(type,data,event){
dojo.widget.byId("screenDetail").setContent(data);
ToastEnd();
},
error:function(type,errorObject){window.alert("Error: "+type+"\n"+errorObject.message);}
});
}
function guardar(obj){
obj.disable();
ToastProgress();
Ext.Ajax.request({
url:'sugerenciaguardar.jsp',
method:'POST',
form:'frmFormSugerencia',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
obj.enable();
var data=Ext.util.JSON.decode(response.responseText);
if(!data){ToastError("Error al crear contacto.");return;}
if(data.Consecutivo==""){ToastError("Atención !!! "+data.Msg);return;}
ToastAlert(data.Msg);
}catch(err){
Ext.MessageBox.alert('Error',err.message);
obj.enable();
}
}else{
Ext.MessageBox.alert('Error','Error: ');
ToastError(response.responseText);
obj.enable();
}
}
});
}
}
function Noticias(){
this.Cantidad=cantidad;
this.Listar=listar;
this.Ver=ver;
this.Borrar=borrar;
function cantidad(con,cli,camb){
Ext.Ajax.request({
url:'../servcliente/noticiascantidad.jsp',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Cantidad>0)
try{
Ext.getCmp('tree-panel').getNodeById('NMensajes').setText("Mensajes"+" <span id=\"noticia\">Nuevos</span>");
try{
Ext.getCmp('tree-panel').getNodeById('MNoticias').setText("Noticias"+" <span id=\"noticia\">("+data.Cantidad+")</span>");
}catch(e){}
}catch(e){}
else
try{
Ext.getCmp('tree-panel').getNodeById('NMensajes').setText("Mensajes");
try{
Ext.getCmp('tree-panel').getNodeById('MNoticias').setText("Noticias");
}catch(e){}
}catch(e){}
}catch(err){
}
}else{
}
}
});
}
function listar(m){
if(m){
dojo.io.bind({
url:"noticiaslistar.jsp",
mimetype:"text/html",
method:"GET",
preventCache:"true",
load:function(type,data,event){
$("screenDetailNoticia").innerHTML=data;
ToastEnd();
},
error:function(type,errorObject){window.alert("Error: "+type+"\n"+errorObject.message);}
});
}else{
var id='docs-noticias';
var t=tabs.getComponent(id);
if(t){
tabs.setActiveTab(t);
return;
}
tabs.add({
title:'Noticias',
id:id,
autoLoad:{url:'noticiaslistar2.jsp',scripts:true,
text:'Cargando ...',
callback:null,
scope:null,
discardUrl:false,
nocache:true,
timeout:30},
closable:true
}).show();
}
}
function ver(c){
var win=new Ext.Window({
width:550,
height:380,
shadow:true,
closable:true,
layout:'fit',
plain:true,
modal:true,
resizable:false,
title:'Noticia',
autoLoad:{
url:'noticiaver.jsp',
params:{Consecutivo:c},
scripts:true,
text:'Cargando ...'
}
});
win.show();
}
var p5Event=function(e){
e.sequenceFx();
e.frame();
e.fadeOut({
endOpacity:0,
easing:'easeOut',
duration:1,
remove:false,
useDisplay:false
});
};
function borrar(num,pan){
ToastProgress();
Ext.Ajax.request({
url:'noticiaseliminar.jsp',
method:'POST',
params:{consecutivo:num},
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg!=null){
ToastAlert(data.Msg);
p5Event(Ext.getCmp(pan).getEl());
}else{
if(data.error!=null)
ToastError(data.error);
}
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
Ext.MessageBox.alert('Error','Error: ');
ToastError(response.responseText);
}
}
});
}
}
function Utils(){
this.ServicioCliente=serviciocliente;
this.Productos=productos;
this.Reporte=reporte;
this.ReporteC=reportec;
this.Manual=manual;
this.Configuracion=configuracion;
this.Cumpleanero=cumpleanero;
this.CumpleaneroTermina=cumpleanerotermina;
this.SMS=sms;
this.Tab=tab;
this.Ayuda=ayuda;
this.SMSMasivo=smsmasivo;
this.SMSPreview=smspreview;
this.SMSKeyUp=smskeyup;
this.SMSGuardar=smsguardar;
this.SmsguardarEnAgenda=smsguardarEnAgenda;
this.SmseliminardeAgenda=smseliminardeAgenda;
this.SMSgetformatedsms=getformatedsms;
this.RoboDocumento=robodocumento;
this.AutoTab=autotab;
this.Sessiones=sessiones;
this.GuardaTheme=guardatheme;
function smseliminardeAgenda(num){
ToastProgress();
Ext.Ajax.request({
url:'sms_eliminardeAgenda.jsp?consecutivo='+num,
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg!=null){
ToastAlert(data.Msg);
}else{
ToastError(data.Msg);
}
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
Ext.MessageBox.alert('Error','Error: ');
ToastError(response.responseText);
}
}
});
}
function smsguardarEnAgenda(uid,nombre,numero){
Ext.Ajax.request({
url:'sms_guardarEnAgenda.jsp?uid='+uid+'&nombre='+nombre+'&numero='+numero,
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg!=null){
}else{
ToastError(data.Msg);
}
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
Ext.MessageBox.alert('Error','Error: ');
ToastError(response.responseText);
}
}
});
}
function tab(obj,v){
vec=document.getElementsByName("tab");
for(var i=0;i<vec.length;i++){
vec[i].className="";
}
obj.className='on';
}
function robodocumento(){
var id='docs-robo';
var t=tabs.getComponent(id);
if(t){
tabs.setActiveTab(t);
return;
}
tabs.add({
title:'Robo Documento',
id:id,
autoLoad:{url:'robodocumentos.jsp',
scripts:true,
text:'Cargando ...',
callback:null,
scope:null,
discardUrl:false,
nocache:true,
timeout:30
},
closable:true
}).show();
}
function sessiones(){
var id='docs-sessiones';
var t=tabs.getComponent(id);
if(t){
tabs.setActiveTab(t);
return;
}
tabs.add({
title:'Sessiones Web',
id:id,
autoLoad:{url:'sessionesweb.jsp',
scripts:true,
text:'Cargando ...',
callback:null,
scope:null,
discardUrl:false,
nocache:true,
timeout:30},
closable:true
}).show();
}
function serviciocliente(){
ToastProgress();
dojo.io.bind({
url:"serviciocliente.jsp",
mimetype:"text/html",
method:"GET",
preventCache:"true",
load:function(type,data,event){
dojo.widget.byId("screenDetail").setContent(data);
ToastEnd();
},
error:function(type,errorObject){window.alert("Error: "+type+"\n"+errorObject.message);}
});
}
function reporte(){
var id='docs-reporteE';
var t=tabs.getComponent(id);
if(t){
tabs.setActiveTab(t);
return;
}
tabs.add({
title:'Reporte Estudios',
id:id,
autoLoad:{
url:'reporte2.jsp',
scripts:true,
text:'Cargando ...',
callback:null,
scope:null,
discardUrl:false,
nocache:true,
timeout:30
},
closable:true
}).show();
}
function reportec(){
var id='docs-reportec';
var t=tabs.getComponent(id);
if(t){
tabs.setActiveTab(t);
return;
}
tabs.add({
title:'Reporte Comercial',
id:id,
autoLoad:{url:'reportesc.jsp',
scripts:true,
text:'Cargando ...',
callback:null,
scope:null,
discardUrl:false,
nocache:true,
timeout:30
},
closable:true
}).show();
}
function productos(){
ToastProgress();
dojo.io.bind({
url:"productos.jsp",
mimetype:"text/html",
method:"GET",
load:function(type,data,event){
dojo.widget.byId("screenDetail").setContent(data);
ToastEnd();
},
error:function(type,errorObject){window.alert("Error: "+type+"\n"+errorObject.message);}
});
}
function manual(){
ToastProgress();
dojo.io.bind({
url:"manual.jsp",
mimetype:"text/html",
method:"GET",
load:function(type,data,event){
dojo.widget.byId("screenDetail").setContent(data);
ToastEnd();
},
error:function(type,errorObject){window.alert("Error: "+type+"\n"+errorObject.message);}
});
}
function sms(t){
var id='docs-sms';
var sms=tabs.getComponent(id);
if(sms){
tabs.setActiveTab(sms);
return;
}
tabs.add({
title:'SMS',
id:id,
autoLoad:{url:'sms.jsp',
scripts:true,
text:'Cargando ...',
params:{Celular:t},
callback:null,
scope:null,
discardUrl:false,
nocache:true,
timeout:30
},
closable:true
}).show();
}
function configuracion(u){
var id='docs-conf';
var t=tabs.getComponent(id);
if(t){
tabs.setActiveTab(t);
return;
}
tabs.add({
title:'Configuración',
id:id,
autoLoad:{url:'configuracion.jsp',
scripts:true,
text:'Cargando ...',
callback:null,
scope:null,
discardUrl:false,
nocache:true,
timeout:30
},
closable:true
}).show();
}
function smsmasivo(){
var id='docs-masivo';
var t=tabs.getComponent(id);
if(t){
tabs.setActiveTab(t);
return;
}
tabs.add({
title:'SMS Masivo',
id:id,
autoLoad:{url:'sms_masivo.jsp',
scripts:true,
text:'Cargando ...',
callback:null,
scope:null,
discardUrl:false,
nocache:true,
timeout:30
},
closable:true
}).show();
}
function getformatedsms(){
try{
var celular=Ext.getCmp("txtPara").getValue();
var empresa=Ext.getCmp("txtEmpresa").getValue();
var remitente=Ext.getCmp("txtRemitente").getValue();
var telefono=Ext.getCmp("telefono").getValue();
var sms=Ext.getCmp("txtSMS").getValue();
if(celular==""){
window.alert("Debe indicar un número de celular ó teléfono móvil válido.");
return;
}
var completedsms="";
if(empresa!="")completedsms=empresa+"/";
if(remitente!="")completedsms+=remitente+"/";
if(telefono!="")completedsms+=telefono+"/";
if(sms!="")completedsms+=sms;
return completedsms;
}catch(e){
return"";
}
}
function smspreview(){
var completedsms=getformatedsms();
var celular=$("txtPara").value.trim();
completedsms=URLEncode(completedsms);
window.open("smspreview.jsp?Celular="+celular+"&SMS="+completedsms,"_blank","status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=256px,height=539px");
}
function smskeyup(obj){
var completedsms=getformatedsms();
$("txtCant").value=completedsms.length;
if(completedsms.length>153){
window.alert("Longitud máxima alcanzada. Por favor revise su mensaje de texto.");
if(obj.value.length>0)
obj.value=obj.value.substring(0,obj.value.length-1);
}
dojo.widget.byId("smsBar").setProgressValue(completedsms.length);
}
function smsguardar(obj){
obj.disable();
ToastProgress();
Ext.Ajax.request({
url:'smsguardar.jsp',
form:'frmFormSMS',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
obj.enable();
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg!=null){
Ext.MessageBox.alert("Alerta !!!",data.Msg);
ToastAlert(data.Msg);
}else{
ToastError(data.Msg);
}
}catch(err){
Ext.MessageBox.alert('Error',err.message);
obj.enable();
}
}else{
ToastError(response.responseText);
obj.enable();
}
}
});
}
function guardatheme(){
ToastProgress();
Ext.Ajax.request({
url:'theme_guarda.jsp',
form:'FormTheme',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg!=null){
ToastAlert(data.Msg);
}else{
ToastError(data.Msg);
}
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
function cumpleanero(){
Ext.Ajax.request({
url:'cumpleanero.jsp',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.msg){
var win=new Ext.Window({
width:320,
height:360,
shadow:true,
closable:true,
layout:'fit',
plain:true,
resizable:false,
title:'Feliz Cumpleaños',
autoLoad:{
url:'cumpleaneros.jsp',
scripts:true,
text:'Cargando ...'
}
});
win.show();
}
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
function cumpleanerotermina(){
Ext.Ajax.request({
url:'cumpleaneros_terminar.jsp',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.msg){
ToastAlert(data.msg);
}
if(data.error){
ToastError(data.error);
}
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
function autotab(original,before,destination){
if(original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
destination.focus(true);
else
if(original.getAttribute&&original.value.length==0){
before.focus(true);
before.select();}
}
function ayuda(){
var id='docs-ayuda';
var t=tabs.getComponent(id);
if(t){
tabs.setActiveTab(t);
return;
}
tabs.add({
title:'Ayuda',
id:id,
autoLoad:{url:'ayuda.jsp',
scripts:true,
text:'Cargando ...',
callback:null,
scope:null,
discardUrl:false,
nocache:true,
timeout:30
},
closable:true
}).show();
}
}
function ReporteComercial(){
this.Buscar=buscar;
this.Abrir=abrir;
this.Guardar=guardar;
this.Cargar=cargar;
this.Regresar=regresar;
function buscar(){
if(valida()){
Ext.get("screenDetailReportelista").load({
url:"reportesc_buscar.jsp",
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:true,
form:'frmsujetos',
text:"Cargando ..."
});
}
}
function valida(){
if((Ext.getCmp("documento").getValue()=="")&&(Ext.getCmp("nombre").getValue()=="")){
ToastError("Los dos campos de busqueda no pueden ser vacios...");
return false;
}
if((Ext.getCmp("documento").getValue()!="")&&(Ext.getCmp("nombre").getValue()!="")){
ToastError("Por favor selecione solo un criterio de busqueda...");
return false;
}
return true;
}
function abrir(cons,ced){
$('screenDetailReportelista').innerHTML="";
Ext.onReady(function(){
Ext.get("screenDetailReporte").load({
url:"reportesc_editar.jsp",
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:true,
params:{"Consecutivo":cons,"Identificacion":ced},
text:"Cargando ..."
});
},true);
}
function regresar(ced){
var id='docs-RComercial';
var t=tabs.getComponent(id);
t.load({
url:"reportesc.jsp",
scripts:true,
callback:function(){
Ext.get("screenDetailReportelista").load({
url:"reportesc_buscar.jsp",
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:true,
params:{"documento":ced},
text:"Cargando ..."
});
},
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando ..."
});
}
function guardaDetalle(rep){
var storeDetalle=Ext.getCmp('gridDetalleR').getStore();
storeDetalle.each(function(r){
r.set("reporte",rep);
r.set("fechaDetalle",r.data.fecha.dateFormat('d-m-Y'));
Ext.Ajax.request({
url:'reportesc_detalleguardar.jsp',
params:r.data,
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
ToastError(response.responseText);
}
}
});
});
storeDetalle.load();
}
function guardar(){
if(Ext.getCmp('gridDetalleR').getStore().data.length>0){
ToastProgress();
Ext.Ajax.request({
url:'reportesc_guardar.jsp',
form:'frmreporte',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.reporte)
Ext.getCmp("consecutivo").setValue(data.reporte);
guardaDetalle(data.reporte);
if(data.Msg){
ToastAlert(data.Msg);
}
if(data.Error){
ToastError(data.Error);
}
}catch(err){
Ext.MessageBox.alert('Error',err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}else{
Ext.Msg.alert('Error','Este Reporte no Tiene detalle por favor incluirle uno antes de guardarlo.');
}
}
function cargar(c){
if((c)&&(c!=0)){
ToastProgress();
dojo.io.bind({
url:"reportesc_json.jsp",
mimetype:"text/json",
method:"POST",
preventCache:"true",
content:{"consecutivo":c},
load:function(type,data,event){
ToastEnd();
if(data){
dojo.byId("consecutivo").value=data.consecutivo;
dojo.byId("acreedor").value=data.acreedor;
dojo.byId("actividad").value=data.actividad;
dojo.byId("telefono").value=data.telefono;
dojo.byId("fecha").value=data.fecha;
dojo.byId("tasa").value=data.tasa;
dojo.byId("plazo").value=data.plazo;
dojo.byId("limite").value=data.limite;
Ext.getCmp("cmbtiposdoc").selectByValue(data.documento,true);
Ext.getCmp("cmbtiposdoc").setValue(data.documento);
Ext.getCmp("cmbtipocredito").selectByValue(data.credito,true);
Ext.getCmp("cmbtipocredito").setValue(data.credito);
Ext.getCmp("cmbtipocredito").selectByValue(data.parte,true);
Ext.getCmp("cmbtipocredito").setValue(data.parte);
Ext.getCmp("cmbmonedarep").selectByValue(data.moneda,true);
Ext.getCmp("cmbmonedarep").setValue(data.moneda);
}
},
error:function(type,errorObject){window.alert("Error: "+type+"\n"+errorObject.message);}
});
}
}
}
function RoboDocumento(){
this.Buscar=buscar;
this.BuscarCedula=buscarcedula;
this.Guardar=guardar;
this.Borrar=borrar;
this.Editar=editar;
this.Nuevo=nuevo;
function nuevo(){
$('nombre').innerHTML="";
$('txtIdent').value="";
$('txtFecha').value="";
$('txtMensaje').value="";
$('documentos').innerHTML="";
}
function buscar(){
if($('txtIdent').value!=""){
ToastProgress();
Ext.Ajax.request({
url:'buscar_sujeto.jsp',
form:'frmFormRobo',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg)
ToastAlert(data.Msg);
$("nombre").innerHTML=data.nombre;
buscarcedula();
ToastEnd()
}catch(err){
ToastError(err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}else
ToastAlert("Debe digitar una identificación ...");
}
function buscarcedula(){
Ext.get("Divdocumentos").load({
url:"robodocumentos_lista.jsp",
params:{txtIdent:$("txtIdent").value},
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function borrar(c){
ToastProgress();
Ext.Ajax.request({
url:'robodocumentos_borrar.jsp',
params:{Identificacion:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg)
ToastAlert(data.Msg);
if(data.Error)
ToastError(data.Error);
buscarcedula();
}catch(err){
ToastError(err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
function editar(c){
ToastProgress();
Ext.Ajax.request({
url:'robodocumentos_editar.jsp',
params:{Identificacion:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
$('txtIdent').value=data.Identificacion;
$('txtFechaRobo').value=data.fecha;
$('txtMensaje').value=data.mensaje;
ToastEnd();
}catch(err){
ToastError(err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
function guardar(){
ToastProgress();
Ext.Ajax.request({
url:'robodocumentos_guarda.jsp',
form:'frmFormRobo',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg)
ToastAlert(data.Msg);
if(data.Error)
ToastError(data.Error);
buscarcedula();
}catch(err){
ToastError(err.message);
}
}else{
ToastError(response.responseText);
}
}
});
}
}
function llamadas(){
this.Abrir=abrir;
this.Guardar=guardar;
function abrir(){
ToastProgress();
dojo.io.bind({
url:"llamadas.jsp",
mimetype:"text/html",
method:"GET",
load:function(type,data,event){
dojo.widget.byId("screenDetail").setContent(data);
ToastEnd();
},
error:function(type,errorObject){window.alert("Error: "+type+"\n"+errorObject.message);}
});
}
function guardar(obj){
obj.disable();
ToastProgress();
Ext.Ajax.request({
url:'llamadasguardar.jsp',
form:'frmFormLlamadas',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
obj.enable();
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg=='ok'){
ToastEnd();
Ext.Msg.show({
title:'Llamada Solicitada',
msg:'Hemos recibido su notificación correctamente en nuestro departamento de servicio al cliente;\ncon mucho gusto le estaremos devolviendo la llamada lo antes posible. Es un placer servirle.\n\nAtentamente: Departamento de servicio al cliente. Cero Riesgo, S.A.',
buttons:Ext.Msg.OK,
animEl:'elId',
icon:Ext.MessageBox.INFO
});
$("consecutivo").value=data.Consecutivo;
return;
}
else{
ToastAlert(data.Msg);
obj.enable();
}
}catch(err){
ToastError(err.message);
obj.enable();
}
}else{
ToastError(response.responseText);
obj.enable();
}
}
});
}
}
function SMSMasivo(){
this.Guardar=guardar;
this.RevisaCelular=revisacelular;
this.ValidaPrueba=validaprueba;
this.GetFormatedsms=getformatedsms;
var Max=3000;
function revisacelular(){
ToastProgress();
CuentaCelular();
}
function getformatedsms(){
try{
var celular=Ext.getCmp("txtParaMasivo").getValue();
var empresa=Ext.getCmp("txtEmpresaMasivo").getValue().replace("Ej. 0Riesgo S.A.","");
var remitente=Ext.getCmp("txtDeptMasivo").getValue().replace("Ej. Tecnologia","");
var sms=Ext.getCmp("txtSMSMasivo").getValue();
if(celular==""){
ToastError("Debe indicar un número de celular ó teléfono móvil válido.");
return;
}
var completedsms="";
if(empresa!="")completedsms=empresa+"/";
if(remitente!="")completedsms+=remitente+"/";
if(sms!="")completedsms+=sms;
return completedsms;
}
catch(e){
return"";
}
}
function validaprueba(a){
if(a.checked){
if($("txtCant").value>10){
ToastError("Para mandar una prueba deben de ser menos de 10 numero ....");
return false;
}
}
return true;
}
function Valida(){
if(validaprueba($("chkPrioridad"))){
var sms=$("txtSMSMasivo").value.replace('Escribeme ...','');
if($("txtCant").value>Max){
ToastError("Solo puede mandar un maximo de "+Max+" ....");
return false;
}
if($("txtCant").value<1){
ToastError("No tiene numeros de celulares ....");
return false;
}
if($("txtCant").value==""){
ToastError("No tiene numeros de celulares ....");
return false;
}
if(sms==""){
ToastError("No ha escrito ningun mensaje ....");
return false;
}
return true
}
}
function CuentaCelular(){
var cel="De los primeros Celulares hay malos";
var cont=0;
var content=Ext.getCmp("txtParaMasivo").getValue();
content=content.split("\n");
var malos=[];
Ext.getCmp("txtCant").setValue(content.length);
for(var i=0;i<content.length;i++){
if(isTelefono(content[i].replace(/^\s*|\s*$/g,""))==false){
malos[cont]=content[i];
content[i]=null;
cont+=1;
}
}
Ext.getCmp("txtParaMasivo").setValue("");
var total=[];
var j=0;
for(var i=0;i<malos.length;i++,j++){
if(malos[i]!="")
total[j]=malos[i].substring(0,8).replace(/^\s*|\s*$/g,"")+"\n";
}
j=0;
for(var i=0;i<content.length;i++,j++){
if(content[i]!=null)
total[j]=content[i].substring(0,8).replace(/^\s*|\s*$/g,"")+"\n";
}
var prueba=total.toString().substring(0,total.toString().length-1)
Ext.getCmp("txtParaMasivo").setValue(prueba.replace(/[',']/g,''));
if(cont>0)
ToastError(cel+cont);
else
ToastEnd();
}
function isTelefono(tel){
if((tel.length==8)&&(tel.substring(0,1)=='8'))
return true;
else
return false;
}
function guardar(obj){
obj.disable();
var completedsms=getformatedsms();
if(completedsms.length>153){
t.enable();
ToastError("Longitud máxima alcanzada.\nPor favor revise su mensaje de texto y corríjalo de ser necesario.");
return;
}
if(!Valida())
return;
ToastProgress();
Ext.Ajax.request({
url:'sms_masivoguardar.jsp',
form:'frmFormMasivo',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
obj.enable();
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
Ext.MessageBox.alert(data.Msg);
obj.enable();
}else{
Ext.MessageBox.alert(data.error);
ToastError(data.error);
obj.enable();
}
}catch(err){
ToastError(err.message);
obj.enable();
}
}else{
ToastError(response.responseText);
obj.enable();
}
obj.enable();
}
});
}
}
function Configuracion(){
this.Guardar=guardar;
this.GuardarVista=guardarvista;
this.Editar=editar;
this.Borrar=borrar;
this.Lista=lista;
function lista(){
Ext.onReady(function(){
Ext.get("listatopicos").load({
url:"configuracion_listatopicos.jsp",
form:'frmFormConf',
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando ..."
});
},true);
}
function guardar(){
ToastProgress();
Ext.Ajax.request({
url:'configuracion_guarda.jsp',
form:'frmFormConf',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
lista();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function guardarvista(){
ToastProgress();
Ext.Ajax.request({
url:'configuracion_guardavista.jsp',
form:'frmFormConf',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function editar(t,cant,c){
$("cmbTopicos").value=t;
$("cmbCantidad").value=cant;
borrar(c,t);
}
function borrar(c,t){
ToastProgress();
Ext.Ajax.request({
url:'configuracion_borra.jsp',
params:{
contacto:c,topico:t
},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
lista();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
}
function Chat(){
this.Register=register;
this.LogOut=logout;
this.Contactos=contactos;
this.ContactosBuscar=contactosbuscar;
this.ContactoAgregar=contactoagregar;
this.ContactoEliminar=contactoeliminar;
function logout(exit){
Ext.Ajax.request({
url:'../chat/logout.jsp',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
if(exit)
window.location.href="../seguridad/logout.jsp?PAGE=../main/index.jsp";
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function register(){
Ext.Ajax.request({
url:'../chat/register.jsp',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function contactos(m){
if(m){
Ext.get("divlistacontactos").load({
url:"contactos.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}else
{
var id='docs-lisContacto';
var t=tabs.getComponent(id);
if(t){
tabs.setActiveTab(t);
return;
}
tabs.add({
title:'Contactos',
id:id,
listeners:{activate:contacto},
closable:true
}).show();
}
}
function contacto(tab){
tab.load({
url:"contactos.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function contactosbuscar(c){
if(c.trim()==""){
Ext.Msg.alert('Error !!!','No ha indicado un criterio de búsqueda.');
return;
}else if(c.trim().length<=3){
Ext.Msg.alert('Atención !!!',c+" es un criterio muy pequeño para realizar la búsqueda.");
return;
}
Ext.get("divlistacontactos").load({
url:"contactosbuscar.jsp",
params:{Criterio:c},
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function contactoeliminar(c){
ToastProgress();
Ext.Ajax.request({
url:'../chat/contactoeliminar.jsp',
method:'POST',
params:{Contacto:c},
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function contactoagregar(c){
ToastProgress();
Ext.Ajax.request({
url:'../chat/contactoagregar.jsp',
method:'POST',
disableCaching:true,
params:{Contacto:c},
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
}
function ReporteEstudios(){
this.Generar=generar;
function generar(c,p){
if(c.trim()==""){
Ext.Msg.alert('Error !!!','No ha selecionado ningun contacto');
return;
}
if(p.trim()==""){
Ext.Msg.alert('Error !!!','No ha selecionado ningun paquete');
return;
}
$('cmbUsuarios').value=c;
$('cmbPaquetes').value=p;
$('frmFormReporte').action='reportelistar.jsp';
$('frmFormReporte').target='_blank';
$('frmFormReporte').method='POST';
$('frmFormReporte').submit();
}
}
function scoreDatosGenerales(){
this.DatoGeneralesGuarda=datosgeneralesguarda;
this.DatoGeneralesDefaultGuarda=datosgeneralesdefaultguarda;
this.EdadList=edadlist;
this.EdadGuarda=edadguarda;
this.EdadBorra=edadborra;
this.MiembroJuntaList=miembrojuntalist;
this.MiembroJuntaGuarda=miembrojuntaguarda;
this.MiembroJuntaBorra=miembrojuntaborra;
this.SalarioList=salariolist;
this.SalarioGuarda=salarioguarda;
this.SalarioBorra=salarioborra;
this.EstadoCivilList=estadocivillist;
this.EstadoCivilGuarda=estadocivilguarda;
this.EstadoCivilBorra=estadocivilborra;
this.EstadoList=estadolist;
this.EstadoGuarda=estadoguarda;
this.EstadoBorra=estadoborra;
this.OcupacionList=ocupacionlist;
this.OcupacionGuarda=ocupacionguarda;
this.OcupacionBorra=ocupacionborra;
function datosgeneralesguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreDG_guarda.jsp',
form:'frmScoreDG',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function datosgeneralesdefaultguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreDGD_guarda.jsp',
form:'frmScoreDGD',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function edadguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreEdad_guarda.jsp',
form:'frmScoreE',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
edadlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function edadborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreEdad_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
edadlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function edadlist(){
Ext.get("DivScoreEdadList").load({
url:"scoreEdadList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function miembrojuntaguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreJunta_guarda.jsp',
form:'frmScoreJ',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
miembrojuntalist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function miembrojuntaborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreJunta_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
miembrojuntalist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function miembrojuntalist(){
Ext.get("DivScoreJuntaList").load({
url:"scoreJuntaList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function estadocivilguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreEstadoCivil_guarda.jsp',
form:'frmScoreEC',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
estadocivillist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function estadocivillist(){
Ext.get("DivScoreEstadoCivilList").load({
url:"scoreEstadoCivilList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function estadocivilborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreEstadoCivil_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
estadocivillist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function estadoguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreEstados_guarda.jsp',
form:'frmScoreES',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
estadolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function estadolist(){
Ext.get("DivScoreEstadosList").load({
url:"scoreEstadosList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function estadoborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreEstados_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
estadolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function ocupacionguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreOcupacion_guarda.jsp',
form:'frmScoreO',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
ocupacionlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function ocupacionlist(){
Ext.get("DivScoreOcupacionList").load({
url:"scoreOcupacionList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function ocupacionborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreOcupacion_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
ocupacionlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function salarioguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreSalario_guarda.jsp',
form:'frmScoreS',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
salariolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function salarioborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreSalario_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
salariolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function salariolist(){
Ext.get("DivScoreSalarioList").load({
url:"scoreSalarioList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
}
function scoreVehiculos(){
this.CantidadList=cantidadlist;
this.CantidadGuarda=cantidadguarda;
this.CantidadBorra=cantidadborra;
this.MarcaList=marcalist;
this.MarcaGuarda=marcaguarda;
this.MarcaBorra=marcaborra;
this.PrendaCantList=prendacantlist;
this.PrendaCantGuarda=prendacantguarda;
this.PrendaCantBorra=prendacantborra;
this.PrendaMontoList=prendamontolist;
this.PrendaMontoGuarda=prendamontoguarda;
this.PrendaMontoBorra=prendamontoborra;
function cantidadguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreVehiculoCant_guarda.jsp',
form:'frmScoreVC',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
cantidadlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function cantidadborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreVehiculoCant_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
cantidadlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function cantidadlist(){
Ext.get("DivScoreVehiculoList").load({
url:"scoreVehiculoCantList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function marcaguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreVehiculoMarca_guarda.jsp',
form:'frmScoreVM',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
marcalist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function marcaborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreVehiculoMarca_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
marcalist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function marcalist(){
Ext.get("DivScoreVehiculosMList").load({
url:"scoreVehiculoMarcaList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function prendacantguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scorePrendaCant_guarda.jsp',
form:'frmScorePC',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
prendacantlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function prendacantborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scorePrendaCant_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
prendacantlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function prendacantlist(){
Ext.get("DivScorePrendaCantList").load({
url:"scorePrendaCantList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function prendamontoguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scorePrendaMonto_guarda.jsp',
form:'frmScorePM',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
prendamontolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function prendamontoborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scorePrendaMonto_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
prendamontolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function prendamontolist(){
Ext.get("DivScorePrendaMontoList").load({
url:"scorePrendaMontoList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
}
function scorePropiedades(){
this.CantidadList=cantidadlist;
this.CantidadGuarda=cantidadguarda;
this.CantidadBorra=cantidadborra;
this.UbicacionList=ubicacionlist;
this.UbicacionGuarda=ubicacionguarda;
this.UbicacionBorra=ubicacionborra;
this.HipotecaCantGuarda=hipotecacantguarda;
this.HipotecaCantBorra=hipotecacantborra;
this.HipotecaCantList=hipotecacantlist;
this.HipotecaMontoList=hipotecamontolist;
this.HipotecaMontoGuarda=hipotecamontoguarda;
this.HipotecaMontoBorra=hipotecamontoborra;
function cantidadguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scorePropiedadCant_guarda.jsp',
form:'frmScorePC',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
cantidadlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function cantidadborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scorePropiedadCant_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
cantidadlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function cantidadlist(){
Ext.get("DivScorePropiedadCantList").load({
url:"scorePropiedadCantList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function ubicacionguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scorePropiedadUbicacion_guarda.jsp',
form:'frmScorePU',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
ubicacionlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function ubicacionborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scorePropiedadUbicacion_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
cantidadlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function ubicacionlist(){
Ext.get("DivScorePropiedadUbicacionList").load({
url:"scorePropiedadUbicacionList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function hipotecacantguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreHipotecaCant_guarda.jsp',
form:'frmScoreHC',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
hipotecacantlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function hipotecacantborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreHipotecaCant_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
hipotecacantlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function hipotecacantlist(){
Ext.get("DivScoreHipotecaCantList").load({
url:"scoreHipotecaCantList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function hipotecamontoguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreHipotecaMonto_guarda.jsp',
form:'frmScoreHM',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
hipotecamontolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function hipotecamontoborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreHipotecaMonto_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
hipotecamontolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function hipotecamontolist(){
Ext.get("DivScoreHipotecaMontoList").load({
url:"scoreHipotecaMontoList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
}
function scoreJuicios(){
this.CantidadList=cantidadlist;
this.CantidadGuarda=cantidadguarda;
this.CantidadBorra=cantidadborra;
this.AnnoList=annolist;
this.AnnoGuarda=annoguarda;
this.AnnoBorra=annoborra;
this.MontoList=montolist;
this.MontoGuarda=montoguarda;
this.MontoBorra=montoborra;
this.EstadoList=estadolist;
this.EstadoGuarda=estadoguarda;
this.EstadoBorra=estadoborra;
function cantidadguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreJuicioCant_guarda.jsp',
form:'frmScoreJC',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
cantidadlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function cantidadborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreJuicioCant_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
cantidadlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function cantidadlist(){
Ext.get("DivScoreJuicioCantList").load({
url:"scoreJuicioCantList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function annoguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreJuicioAnno_guarda.jsp',
form:'frmScoreJA',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
annolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function annoborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreJuicioAnno_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
annolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function annolist(){
Ext.get("DivScoreJuicioAnnoList").load({
url:"scoreJuicioAnnoList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function montoguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreJuicioMonto_guarda.jsp',
form:'frmScoreJM',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
montolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function montoborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreJuicioMonto_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
montolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function montolist(){
Ext.get("DivScoreJuicioMontoList").load({
url:"scoreJuicioMontoList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function estadoguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreJuicioEstado_guarda.jsp',
form:'frmScoreJE',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
estadolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function estadoborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreJuicioEstado_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
estadolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function estadolist(){
Ext.get("DivScoreJuicioEstadoList").load({
url:"scoreJuicioEstadoList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
}
function scoreReporte(){
this.List=list;
this.Guarda=guarda;
this.Borra=borra;
this.CalidadList=calidadlist;
this.CalidadGuarda=calidadguarda;
this.CalidadBorra=calidadborra;
this.ServicioList=serviciolist;
this.ServicioGuarda=servicioguarda;
this.ServicioBorra=servicioborra;
this.GarantiaList=garantialist;
this.GarantiaGuarda=garantiaguarda;
this.GarantiaBorra=garantiaborra;
this.EmisionList=emisionlist;
this.EmisionGuarda=emisionguarda;
this.EmisionBorra=emisionborra;
this.LimiteList=limitelist;
this.LimiteGuarda=limiteguarda;
this.LimiteBorra=limiteborra;
this.SaldoList=saldolist;
this.SaldoGuarda=saldoguarda;
this.SaldoBorra=saldoborra;
this.FechaList=fechalist;
this.FechaGuarda=fechaguarda;
this.FechaBorra=fechaborra;
function guarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreReporte_guarda.jsp',
form:'frmScoreRM',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
list();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function borra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreReporte_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
list();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function list(){
Ext.get("DivScoreReporteList").load({
url:"scoreReporteList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function calidadguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreReporteCalidad_guarda.jsp',
form:'frmScoreRC',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
calidadlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function calidadborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreReporteCalidad_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
calidadlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function calidadlist(){
Ext.get("DivScoreReporteCalidadList").load({
url:"scoreReporteCalidadList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function servicioguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreReporteServicio_guarda.jsp',
form:'frmScoreRS',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
serviciolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function servicioborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreReporteServicio_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
serviciolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function serviciolist(){
Ext.get("DivScoreReporteServicioList").load({
url:"scoreReporteServicioList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function garantiaguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreReporteGarantia_guarda.jsp',
form:'frmScoreRG',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
garantialist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function garantiaborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreReporteGarantia_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
garantialist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function garantialist(){
Ext.get("DivScoreReporteGarantiaList").load({
url:"scoreReporteGarantiaList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function emisionguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreReporteEmision_guarda.jsp',
form:'frmScoreRE',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
emisionlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function emisionborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreReporteEmision_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
emisionlist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function emisionlist(){
Ext.get("DivScoreReporteEmisionList").load({
url:"scoreReporteEmisionList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function limiteguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreReporteLimite_guarda.jsp',
form:'frmScoreRL',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
limitelist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function limiteborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreReporteLimite_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
limitelist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function limitelist(){
Ext.get("DivScoreReporteLimiteList").load({
url:"scoreReporteLimiteList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function saldoguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreReporteSaldo_guarda.jsp',
form:'frmScoreRS',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
saldolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function saldoborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreReporteSaldo_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
saldolist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function saldolist(){
Ext.get("DivScoreReporteSaldoList").load({
url:"scoreReporteSaldoList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
function fechaguarda(){
ToastProgress();
Ext.Ajax.request({
url:'scoreReporteFecha_guarda.jsp',
form:'frmScoreRF',
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
fechalist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function fechaborra(c){
ToastProgress();
Ext.Ajax.request({
url:'scoreReporteFecha_borra.jsp',
params:{Consecutivo:c},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
if(data.Msg){
ToastAlert(data.Msg);
fechalist();
}else{
ToastError(data.error);
}
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
function fechalist(){
Ext.get("DivScoreReporteFechaList").load({
url:"scoreReporteFechaList.jsp",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
}
function Juicios(){
this.Abrir=abrir;
this.Guardar=guardar;
this.Limpiar=limpiar;
this.Nombre=nombre;
this.Buscar=buscar;
this.Regresar=regresar;
function abrir(cons,ced){
$('screenDetailJuicioslista').innerHTML="";
Ext.onReady(function(){
Ext.get("screenDetailJuicios").load({
url:"juicios.jsp",
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:true,
params:{"Consecutivo":cons,"Identificacion":ced},
text:"Cargando ..."
});
},true);
}
function limpiar(){
Ext.getCmp("cedula").setValue("");
Ext.getCmp("consecutivonew").setValue("");
Ext.getCmp("nombre").setValue("");
Ext.getCmp("expediente").setValue("");
Ext.getCmp("causa").setValue("");
Ext.getCmp("txtTribunal").setValue("");
Ext.getCmp("moneda").setValue("");
Ext.getCmp("cuantia").setValue("");
Ext.getCmp("fecha").setValue("");
Ext.getCmp("cedula_demandante").setValue("");
Ext.getCmp("nombre_demandante").setValue("");
Ext.getCmp("tipo").setValue("");
Ext.getCmp("txtEstado").setValue("");
Ext.getCmp("observaciones").setValue("");
}
function guardar(t){
ToastProgress();
dojo.io.bind({
url:"juicios_guardar.jsp",
mimetype:"text/json",
method:"POST",
preventCache:"true",
formNode:dojo.byId("frmjuicios"),
load:function(type,data,event){
if(data){
if(data.msg)
ToastAlert(data.msg);
if(data.error)
ToastError(data.error);
dojo.byId("consecutivo").value=data.consecutivo;
dojo.byId("consecutivonew").value=data.consecutivonew;
lista();
}
},
error:function(type,errorObject){ToastError("Error: "+type+"\n"+errorObject.message);}
});
}
function nombre(obj,ced){
if(ced){
Ext.Ajax.request({
url:'../si/sujeto_nombre.jsp',
params:{"documento":ced},
method:'POST',
disableCaching:true,
callback:function(options,success,response){
if(success){
try{
var data=Ext.util.JSON.decode(response.responseText);
obj.setValue(data.nombre);
}catch(err){
ToastError(err.message+response.responseText);
}
}else{
ToastError(response.responseText);
}
}
});
}
}
function buscar(){
if((Ext.getCmp("documentoj").getValue()!="")||(Ext.getCmp("nombrej").getValue()!="")){
Ext.get("screenDetailJuicioslista").load({
url:"juicioslista.jsp",
form:"frmsujetosJ",
callback:null,
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando...",
timeout:30,
scripts:true
});
}
else
Ext.Msg.alert("Alerta !!!","El campo cédula y el nombre no pueden ser vacios los dos!!!");
}
function regresar(ced){
var id='docs-AJuicios';
var t=tabs.getComponent(id);
t.load({
url:"juiciosbusca.jsp",
scripts:true,
callback:function(){
Ext.get("screenDetailJuicioslista").load({
url:"juicioslista.jsp",
scripts:true,
callback:null,
scope:null,
discardUrl:false,
nocache:true,
params:{"documentoj":ced},
text:"Cargando ..."
});
},
scope:null,
discardUrl:false,
nocache:true,
text:"Cargando ..."
});
}
}

